From c79df23873de27ceca471eb4a857a082e50ef9e4 Mon Sep 17 00:00:00 2001 From: GeorgianaElena Date: Tue, 21 Jul 2020 16:58:54 +0300 Subject: [PATCH] hubtraf user login doesn't raise exceptions anymore --- integration-tests/test_admin_installer.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/integration-tests/test_admin_installer.py b/integration-tests/test_admin_installer.py index dd6e2e8..1f6f38a 100644 --- a/integration-tests/test_admin_installer.py +++ b/integration-tests/test_admin_installer.py @@ -16,9 +16,9 @@ async def test_admin_login(): password = "admin" async with User(username, hub_url, partial(login_dummy, password=password)) as u: - await u.login() - await u.ensure_server_simulate() - + await u.login() + # If user is not logged in, this will raise an exception + await u.ensure_server_simulate() @pytest.mark.asyncio @pytest.mark.parametrize( @@ -35,11 +35,7 @@ async def test_unsuccessful_login(username, password): """ hub_url = 'http://localhost' - try: - async with User(username, hub_url, partial(login_dummy, password="")) as u: - await u.login() - except Exception: - # This is what we except to happen - pass - else: - raise + async with User(username, hub_url, partial(login_dummy, password="")) as u: + user_logged_in = await u.login() + + assert user_logged_in == False