Merge commit '4aa4f82b37aeb272637fafeff498014af1c11c6b' into v3.0.0

This commit is contained in:
2016-02-01 23:39:17 -05:00
2 changed files with 3 additions and 5 deletions
-3
View File
@@ -216,9 +216,6 @@ class Request(RequestHooksMixin):
params = {} if params is None else params
hooks = {} if hooks is None else hooks
# Default empty string for method.
method = '' if method is None else method
self.hooks = default_hooks()
for (k, v) in list(hooks.items()):
self.register_hook(event=k, hook=v)
+3 -2
View File
@@ -110,7 +110,7 @@ class TestRequests(object):
requests.get('http://')
def test_basic_building(self):
req = requests.Request()
req = requests.Request(method='GET')
req.url = 'http://kennethreitz.org/'
req.data = {'life': '42'}
@@ -166,7 +166,8 @@ class TestRequests(object):
s = requests.Session()
s.proxies = getproxies()
parts = urlparse(httpbin('get'))
schemes = ['http://', 'HTTP://', 'hTTp://', 'HttP://']
schemes = ['http://', 'HTTP://', 'hTTp://', 'HttP://',
'https://', 'HTTPS://', 'hTTps://', 'HttPs://']
for scheme in schemes:
url = scheme + parts.netloc + parts.path
r = requests.Request('GET', url)