mirror of https://github.com/huashengdun/webssh
Updated test_policy.py
parent
0cb0706c69
commit
646621279b
|
@ -78,6 +78,16 @@ class TestPolicy(unittest.TestCase):
|
|||
autoadd.is_missing_host_key(client, hostname, key)
|
||||
)
|
||||
|
||||
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:]
|
||||
|
|
Loading…
Reference in New Issue