From ced6550a2555002f6c081d75547f30fd3fc5e29c Mon Sep 17 00:00:00 2001 From: Colin Dickson Date: Tue, 3 Feb 2015 21:23:07 -0500 Subject: [PATCH] split test_connection_error into two distinct tests, and changed "unknown url" test URL since fooobarbangbazbing.httpbin.org currently gives a valid response. --- test_requests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test_requests.py b/test_requests.py index 224b0df..3f496fc 100755 --- a/test_requests.py +++ b/test_requests.py @@ -301,11 +301,13 @@ class RequestsTestCase(unittest.TestCase): r = s.get(url) assert r.status_code == 200 - def test_connection_error(self): + def test_connection_error_invalid_domain(self): """Connecting to an unknown domain should raise a ConnectionError""" with pytest.raises(ConnectionError): - requests.get("http://fooobarbangbazbing.httpbin.org") + requests.get("http://doesnotexist.google.com") + def test_connection_error_invalid_port(self): + """Connecting to an invalid port should raise a ConnectionError""" with pytest.raises(ConnectionError): requests.get("http://httpbin.org:1") -- 2.34.1