diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2017-06-06 12:31:57 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2017-06-06 12:31:57 -0700 |
commit | a2da21d46bb9a441dbb8da570262bb424e1f9450 (patch) | |
tree | 8e1c7bdd402fb640f75b061bc2051f5fe6eba676 /tests/test_hostkeys.py | |
parent | 79fcbdad812cc3be39afbf8375c11e0581eeb86e (diff) | |
parent | d285b80ecb6102b0ad501b74d02e04d61e8ec632 (diff) |
Merge branch '2.0' into 667-int
Diffstat (limited to 'tests/test_hostkeys.py')
-rw-r--r-- | tests/test_hostkeys.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_hostkeys.py b/tests/test_hostkeys.py index 2bdcad9c..2c7ceeb9 100644 --- a/tests/test_hostkeys.py +++ b/tests/test_hostkeys.py @@ -115,3 +115,15 @@ class HostKeysTest (unittest.TestCase): self.assertEqual(b'7EC91BB336CB6D810B124B1353C32396', fp) fp = hexlify(hostdict['secure.example.com']['ssh-dss'].get_fingerprint()).upper() self.assertEqual(b'4478F0B9A23CC5182009FF755BC1D26C', fp) + + def test_delitem(self): + hostdict = paramiko.HostKeys('hostfile.temp') + target = 'happy.example.com' + entry = hostdict[target] # will KeyError if not present + del hostdict[target] + try: + entry = hostdict[target] + except KeyError: + pass # Good + else: + assert False, "Entry was not deleted from HostKeys on delitem!" |