mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
hubtraf user login doesn't raise exceptions anymore
This commit is contained in:
@@ -16,9 +16,9 @@ async def test_admin_login():
|
|||||||
password = "admin"
|
password = "admin"
|
||||||
|
|
||||||
async with User(username, hub_url, partial(login_dummy, password=password)) as u:
|
async with User(username, hub_url, partial(login_dummy, password=password)) as u:
|
||||||
await u.login()
|
await u.login()
|
||||||
await u.ensure_server_simulate()
|
# If user is not logged in, this will raise an exception
|
||||||
|
await u.ensure_server_simulate()
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
@@ -35,11 +35,7 @@ async def test_unsuccessful_login(username, password):
|
|||||||
"""
|
"""
|
||||||
hub_url = 'http://localhost'
|
hub_url = 'http://localhost'
|
||||||
|
|
||||||
try:
|
async with User(username, hub_url, partial(login_dummy, password="")) as u:
|
||||||
async with User(username, hub_url, partial(login_dummy, password="")) as u:
|
user_logged_in = await u.login()
|
||||||
await u.login()
|
|
||||||
except Exception:
|
assert user_logged_in == False
|
||||||
# This is what we except to happen
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
raise
|
|
||||||
|
|||||||
Reference in New Issue
Block a user