projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
95161ed
)
Add test that invalid domain raises a ConnectionError
author
Kevin Burke
<kev@inburke.com>
Fri, 29 Aug 2014 21:07:28 +0000
(14:07 -0700)
committer
Kevin Burke
<kev@inburke.com>
Fri, 29 Aug 2014 21:07:28 +0000
(14:07 -0700)
test_requests.py
patch
|
blob
|
history
diff --git
a/test_requests.py
b/test_requests.py
index 716c0dcff6f7c97d6786b898f08cbdefb17050e1..3868f9dc1f7da132c59d08e4aad1a81164443d64 100755
(executable)
--- a/
test_requests.py
+++ b/
test_requests.py
@@
-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')