def test_public_key_does_not_match2(self): with self.assertRaises(Exception) as ctx: SshKeyManager.check_private_key(self.priv_key2, self.pub_key) self.assertEqual(str(ctx.exception), 'public key does not match')
def test_private_key_not_set(self): with self.assertRaises(Exception) as ctx: SshKeyManager.check_private_key(None, None) self.assertEqual(str(ctx.exception), 'no private key set')