From: Johannes Gorset Date: Thu, 19 May 2011 08:13:42 +0000 (+0200) Subject: Add tests for settings X-Git-Tag: v0.4.1^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21e2d0c34a7f3e7b661ca93cb6afd3c0fcffa3c9;p=services%2Fpython-requests.git Add tests for settings --- diff --git a/test_requests.py b/test_requests.py index 4168672..436b8bc 100755 --- 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__':