def test_duo_auth_auth_duo_offline(self): result = duo_auth_auth('integration_key', 'secret_key', 'host', 'username', 'factor', 'device') self.assertTrue('error' in result) self.assertEqual(result['error'], 'Duo offline. Try again later.')
def test_duo_auth_auth_other_api_error(self): result = duo_auth_auth('integration_key', 'secret_key', 'host', 'username', 'factor', 'device') self.assertTrue('error' in result) self.assertEqual(result['error'], 'Other API Error')
def test_duo_auth_auth_invalid_secret_key(self): result = duo_auth_auth('integration_key', 'secret_key', 'host', 'username', 'factor', 'device') self.assertTrue('error' in result) self.assertEqual(result['error'], 'Invalid secret key')
def test_duo_auth_auth_invalid_cert(self): result = duo_auth_auth('integration_key', 'secret_key', 'host', 'username', 'factor', 'device') self.assertTrue('error' in result) self.assertEqual(result['error'], 'Host incorrect: SSL Certificate Error')
def test_duo_auth_auth_invalid_host(self): result = duo_auth_auth('integration_key', 'secret_key', 'host', 'username', 'factor', 'device') self.assertTrue('error' in result) self.assertEqual(result['error'], 'Host incorrect: Could not be found')
def test_duo_auth_check_success(self): result = duo_auth_auth('integration_key', 'secret_key', 'host', 'username', 'factor', 'device') self.assertTrue(isinstance(result, dict) and 'error' not in result)