aboutsummaryrefslogtreecommitdiff
path: root/test/test_exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_exceptions.py')
-rw-r--r--test/test_exceptions.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test_exceptions.py b/test/test_exceptions.py
new file mode 100644
index 0000000..3e02ca6
--- /dev/null
+++ b/test/test_exceptions.py
@@ -0,0 +1,19 @@
+import unittest
+import pickle
+
+from urllib3.exceptions import HTTPError, MaxRetryError, LocationParseError
+from urllib3.connectionpool import HTTPConnectionPool
+
+
+
+class TestPickle(unittest.TestCase):
+
+ def test_exceptions(self):
+ assert pickle.dumps(HTTPError(None))
+ assert pickle.dumps(MaxRetryError(None, None, None))
+ assert pickle.dumps(LocationParseError(None))
+
+ def test_exceptions_with_objects(self):
+ assert pickle.dumps(HTTPError('foo'))
+ assert pickle.dumps(MaxRetryError(HTTPConnectionPool('localhost'), '/', None))
+ assert pickle.dumps(LocationParseError('fake location'))