diff options
author | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:19:33 -0700 |
---|---|---|
committer | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:19:33 -0700 |
commit | 92b84b67f7b187b81dacbf1ae46d59a1d0b5b125 (patch) | |
tree | e02dc576320cdc51de3d59d899a5c70ed610e24a /test/test_exceptions.py | |
parent | e5b66555b54a9854b340975471e8cdfa64e311f7 (diff) | |
download | python-urllib3-92b84b67f7b187b81dacbf1ae46d59a1d0b5b125.tar python-urllib3-92b84b67f7b187b81dacbf1ae46d59a1d0b5b125.tar.gz |
Imported Upstream version 1.6
Diffstat (limited to 'test/test_exceptions.py')
-rw-r--r-- | test/test_exceptions.py | 19 |
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')) |