commit 646621279b2e689203eb221d89c34704cabbd6e1 parent 0cb0706c69ea59c8079c37336fd7ff4efa896cc7 Author: Sheng <webmaster0115@gmail.com> Date: Thu, 15 Nov 2018 19:49:45 +0800 Updated test_policy.py Diffstat:
M | tests/test_policy.py | | | 10 | ++++++++++ |
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/tests/test_policy.py b/tests/test_policy.py @@ -80,6 +80,16 @@ class TestPolicy(unittest.TestCase): for f in [file1, file2]: entry = paramiko.hostkeys.HostKeys(f)._entries[0] + hostname = entry.hostnames[0] + key = entry.key + key.get_name = lambda: 'unknown' + self.assertTrue( + autoadd.is_missing_host_key(client, hostname, key) + ) + del key.get_name + + for f in [file1, file2]: + entry = paramiko.hostkeys.HostKeys(f)._entries[0] hostname = entry.hostnames[0][1:] key = entry.key self.assertTrue(