Ejemplo n.º 1
0
 def test_invalid_private_key2(self):
     with self.assertRaises(Exception) as ctx:
         SshKeyManager.check_keys(self.pub_key, None)
     self.assertEqual(str(ctx.exception), 'invalid private key')
Ejemplo n.º 2
0
 def test_key_check_error2(self):
     with self.assertRaises(Exception) as ctx:
         SshKeyManager.check_keys(self.priv_key, None)
     self.assertEqual(str(ctx.exception), 'key pair does not match')
Ejemplo n.º 3
0
 def test_key_check_error3(self):
     with self.assertRaises(Exception) as ctx:
         SshKeyManager.check_keys(None, None)
     self.assertEqual(str(ctx.exception), 'invalid private key')
Ejemplo n.º 4
0
 def test_generate_key_pair(self):
     try:
         SshKeyManager.check_keys(self.priv_key, self.pub_key)
     except Exception:  # pylint: disable=broad-except
         self.fail('SshKeyManager.check_keys raised an Exception')