示例#1
0
 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.')
示例#2
0
 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')
示例#3
0
 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')
示例#4
0
 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')
示例#5
0
 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')
示例#6
0
 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)