Skip to content
Myr

- fixed func call syntax on lower to lower()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

- added test cases for trying to test GETS on mixed-case schemas

authored by Viktor Haag · committed by Viktor Haag · parent 3004ad5 · Browse files · 3 files+23 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+23 added−2 removed

  • other:+23 added−2 removed

3 files+23 added−2 removed

modified:requests/adapters.py+1 added-1 removed
116 unmodified lines
117 :param url: The requested URL.118 :param verify: Whether we should actually verify the certificate.119 :param cert: The SSL certificate to verify.120 """121 if url.lower.startswith('https') and verify:121 if url.lower().startswith('https') and verify:122123 cert_loc = None124125 # Allow self-specified cert location.
217 unmodified lines
modified:requests/sessions.py+1 added-1 removed
465 unmodified lines
466 def get_adapter(self, url):467 """Returns the appropriate connnection adapter for the given URL."""468 for (prefix, adapter) in self.adapters.items():469470 if url.lower.startswith(prefix):470 if url.lower().startswith(prefix):471 return adapter472473 # Nothing matches :-/474 raise InvalidSchema("No connection adapters were found for '%s'" % url)
27 unmodified lines
modified:test_requests.py+21 added
85 unmodified lines
86 "http://example.com/path?key=value#fragment", params={"a": "b"}).prepare()87 self.assertEqual(request.url,88 "http://example.com/path?key=value&a=b#fragment")8990 def test_mixed_case_scheme_acceptable(self):91 s = requests.Session()92 r = requests.Request('GET', 'HTTP://httbin.org/get')93 r = s.send(r.prepare())94 self.assertEqual(r.status_code,200)95 r = requests.Request('GET', 'hTTp://httbin.org/get')96 r = s.send(r.prepare())97 self.assertEqual(r.status_code,200)98 r = requests.Request('GET', 'HttP://httbin.org/get')99 r = s.send(r.prepare())100 self.assertEqual(r.status_code,200)101 r = requests.Request('GET', 'HTTPS://httbin.org/get')102 r = s.send(r.prepare())103 self.assertEqual(r.status_code,200)104 r = requests.Request('GET', 'hTTps://httbin.org/get')105 r = s.send(r.prepare())106 self.assertEqual(r.status_code,200)107 r = requests.Request('GET', 'HttPs://httbin.org/get')108 r = s.send(r.prepare())109 self.assertEqual(r.status_code,200)110111 def test_HTTP_200_OK_GET_ALTERNATIVE(self):112 r = requests.Request('GET', httpbin('get'))113 s = requests.Session()114
613 unmodified lines