def test_logout_not_logged_in(self, request): """Test exc thrown when logout() but login() not called.""" http = Http(url=get_url(request), certwarn=False) auth = ApiKey(http=http, **get_key_creds(request)) with pytest.raises(NotLoggedIn): auth.logout()
def test_logout(self, request): """Test no exc when logout() after login().""" http = Http(url=get_url(request), certwarn=False) auth = ApiKey(http=http, **get_key_creds(request)) auth.login() assert auth.is_logged_in auth.logout() assert not auth.is_logged_in