def test_exception_if_wrong_auth(self): with HTTMock(login_invalid): with self.assertRaises(coucheventjoiner.LoginException): coucheventjoiner.login("username", "password")
def test_login_ok(self): with HTTMock(login_ok): s = coucheventjoiner.login("username", "password") self.assertIsInstance(s, requests.Session)