diff options
author | Marius Gedminas <marius@gedmin.as> | 2016-02-04 19:56:51 +0200 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2016-04-24 13:56:42 -0700 |
commit | e1d09fe4b0f4ab8eee5e923dd63ae08155334e80 (patch) | |
tree | 5322746c8c96d9098e76ea4232d36bbefe42c2f9 /tests/test_ssh_exception.py | |
parent | f15b383e4499e85689bfcc83dc942f0b6c898264 (diff) |
Make NoValidConnectionsError picklable correctly
Fixes #617.
Diffstat (limited to 'tests/test_ssh_exception.py')
-rw-r--r-- | tests/test_ssh_exception.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_ssh_exception.py b/tests/test_ssh_exception.py new file mode 100644 index 00000000..2d1f899f --- /dev/null +++ b/tests/test_ssh_exception.py @@ -0,0 +1,15 @@ +import pickle +import unittest + +from paramiko.ssh_exception import NoValidConnectionsError + + +class NoValidConnectionsErrorTest (unittest.TestCase): + + def test_pickling(self): + # Regression test for https://github.com/paramiko/paramiko/issues/617 + exc = NoValidConnectionsError({'ab': ''}) + new_exc = pickle.loads(pickle.dumps(exc)) + self.assertEqual(type(exc), type(new_exc)) + self.assertEqual(str(exc), str(new_exc)) + self.assertEqual(exc.args, new_exc.args) |