diff options
author | Robey Pointer <robey@lag.net> | 2006-11-10 16:44:13 -0800 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2006-11-10 16:44:13 -0800 |
commit | e736341e2018b1e92d426d72ef74f43462f2a327 (patch) | |
tree | f105fd08aaf327d41661b87c9ab2f5e01e3b3112 /tests/test_hostkeys.py | |
parent | 482d0bcef2ab01c98db388f88d650b1d1d35e745 (diff) |
[project @ robey@lag.net-20061111004413-7bab08f1bad7f96f]
bug 70398:
allow constructions like:
hostkeys['hostname'] = {}
to create an empty host entry object, so that future attempts to set
keys will at least not throw an exception. (they'll still silently do
nothing, though.)
Diffstat (limited to 'tests/test_hostkeys.py')
-rw-r--r-- | tests/test_hostkeys.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/test_hostkeys.py b/tests/test_hostkeys.py index b7d9ae92..e9580ddf 100644 --- a/tests/test_hostkeys.py +++ b/tests/test_hostkeys.py @@ -104,9 +104,14 @@ class HostKeysTest (unittest.TestCase): 'ssh-rsa': key, 'ssh-dss': key_dss } - self.assertEquals(2, len(hostdict)) + hostdict['fake.example.com'] = {} + # this line will have no effect, but at least shouldn't crash: + hostdict['fake.example.com']['ssh-rsa'] = key + + self.assertEquals(3, len(hostdict)) self.assertEquals(2, len(hostdict.values()[0])) self.assertEquals(1, len(hostdict.values()[1])) + self.assertEquals(0, len(hostdict.values()[2])) fp = hexlify(hostdict['secure.example.com']['ssh-rsa'].get_fingerprint()).upper() self.assertEquals('7EC91BB336CB6D810B124B1353C32396', fp) fp = hexlify(hostdict['secure.example.com']['ssh-dss'].get_fingerprint()).upper() |