Add failing test for #2872

This commit is contained in:
Ian Cordasco
2015-11-10 21:15:29 -06:00
parent 4e89ba7077
commit 0a1aaca024
+9
View File
@@ -1351,6 +1351,13 @@ class UtilsTestCase(unittest.TestCase):
assert super_len(
cStringIO.StringIO('but some how, some way...')) == 25
def test_super_len_correctly_calculates_len_of_partially_read_file(self):
"""Ensure that we handle partially consumed file like objects."""
from requests.utils import super_len
s = StringIO.StringIO()
s.write('foobarbogus')
assert super_len(s) == 0
def test_get_environ_proxies_ip_ranges(self):
"""Ensures that IP addresses are correctly matches with ranges
in no_proxy variable."""
@@ -1721,6 +1728,7 @@ def test_urllib3_pool_connection_closed(httpbin):
except ConnectionError as e:
assert u"Pool is closed." in str(e)
def test_vendor_aliases():
from requests.packages import urllib3
from requests.packages import chardet
@@ -1728,5 +1736,6 @@ def test_vendor_aliases():
with pytest.raises(ImportError):
from requests.packages import webbrowser
if __name__ == '__main__':
unittest.main()