Add tests for settings
authorJohannes Gorset <jgorset@gmail.com>
Thu, 19 May 2011 08:13:42 +0000 (10:13 +0200)
committerJohannes Gorset <jgorset@gmail.com>
Thu, 19 May 2011 08:13:42 +0000 (10:13 +0200)
test_requests.py

index 4168672..436b8bc 100755 (executable)
@@ -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__':