mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Add tests for settings
This commit is contained in:
@@ -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__':
|
||||
|
||||
Reference in New Issue
Block a user