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:
ec5f227
)
Add tests for settings
author
Johannes Gorset
<jgorset@gmail.com>
Thu, 19 May 2011 08:13:42 +0000
(10:13 +0200)
committer
Johannes Gorset
<jgorset@gmail.com>
Thu, 19 May 2011 08:13:42 +0000
(10:13 +0200)
test_requests.py
patch
|
blob
|
history
diff --git
a/test_requests.py
b/test_requests.py
index
4168672
..
436b8bc
100755
(executable)
--- a/
test_requests.py
+++ b/
test_requests.py
@@
-155,6
+155,16
@@
class RequestsTestSuite(unittest.TestCase):
r = requests.get('https://convore.com/api/account/verify.json', auth=conv_auth)
self.assertEquals(r.status_code, 401)
+
+ def test_settings(self):
+ import urllib2
+
+ with requests.settings(timeout=0):
+ self.assertRaises(urllib2.URLError, requests.get, 'http://google.com')
+
+ with requests.settings(timeout=10):
+ requests.get('http://google.com')
+
if __name__ == '__main__':