Merge remote-tracking branch 'kevinburke/domain-failure-connection-error' into bug/2192

This commit is contained in:
Ian Cordasco
2014-08-29 16:43:51 -05:00
+5
View File
@@ -286,6 +286,11 @@ class RequestsTestCase(unittest.TestCase):
r = s.get(url)
assert r.status_code == 200
def test_connection_error(self):
"""Connecting to an unknown domain should raise a ConnectionError"""
with pytest.raises(ConnectionError):
requests.get("http://fooobarbangbazbing.httpbin.org")
def test_basicauth_with_netrc(self):
auth = ('user', 'pass')
wrong_auth = ('wronguser', 'wrongpass')