diff options
author | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:19:36 -0700 |
---|---|---|
committer | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:19:36 -0700 |
commit | 5f949ee35667a6065ab02a3e7ab8c98c9fcdcaed (patch) | |
tree | 35ce945e6f6fe74276a6745c96e6a48f6e5d3c68 /test/test_compatibility.py | |
parent | 52980ebd0a4eb75acf055a2256e095772c1fa7c6 (diff) | |
download | python-urllib3-5f949ee35667a6065ab02a3e7ab8c98c9fcdcaed.tar python-urllib3-5f949ee35667a6065ab02a3e7ab8c98c9fcdcaed.tar.gz |
Imported Upstream version 1.8
Diffstat (limited to 'test/test_compatibility.py')
-rw-r--r-- | test/test_compatibility.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_compatibility.py b/test/test_compatibility.py new file mode 100644 index 0000000..05ee4de --- /dev/null +++ b/test/test_compatibility.py @@ -0,0 +1,23 @@ +import unittest +import warnings + +from urllib3.connection import HTTPConnection + + +class TestVersionCompatibility(unittest.TestCase): + def test_connection_strict(self): + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + + # strict=True is deprecated in Py33+ + conn = HTTPConnection('localhost', 12345, strict=True) + + if w: + self.fail('HTTPConnection raised warning on strict=True: %r' % w[0].message) + + def test_connection_source_address(self): + try: + # source_address does not exist in Py26- + conn = HTTPConnection('localhost', 12345, source_address='127.0.0.1') + except TypeError as e: + self.fail('HTTPConnection raised TypeError on source_adddress: %r' % e) |