Example #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.')
Example #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')
Example #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')
Example #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')
Example #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')
Example #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)