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')
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')
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')
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')