def test_user_preauth_returns_something(self): c = AccountRESTClient(self.HOST, preauth_key=self.ph_key_domain1) token = c.get_preauth_token(self.lambda_account.name) self.assertIsInstance(token, str)
def test_user_preauth_with_wrong_user_fails(self): with self.assertRaises(RESTClient.RESTBackendError): c = AccountRESTClient(self.HOST, preauth_key=self.ph_key_domain1) c.get_preauth_token('idonotexist1234@'+TEST_CONF['domain_1'])
def test_user_preauth_without_key_fails(self): with self.assertRaises(RESTClient.NoPreauthKeyProvided): c = AccountRESTClient(self.HOST) c.get_preauth_token(self.lambda_account.name)