summaryrefslogtreecommitdiffhomepage
path: root/tests/test_ssh_exception.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_ssh_exception.py')
-rw-r--r--tests/test_ssh_exception.py15
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)