From 56b5f02551cd65cfc99f7f38c60d36b2cfdfc6e8 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 24 Jul 2013 17:18:16 +0900 Subject: [PATCH] Rewrite `test_uppercase_scheme_redirect` to use local httpbin Instead of redirecting to hard-coded 'example.com', use the URL defined in `HTTPBIN_URL` with the path set to the 'html' endpoint. --- test_requests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test_requests.py b/test_requests.py index 9bd720f..0dae1e2 100755 --- a/test_requests.py +++ b/test_requests.py @@ -554,7 +554,9 @@ class RequestsTestCase(unittest.TestCase): ) def test_uppercase_scheme_redirect(self): - r = requests.get(httpbin('redirect-to'), params={'url': 'HTTP://example.com/'}) + parts = urlparse(httpbin('html')) + url = "HTTP://" + parts.netloc + parts.path + r = requests.get(httpbin('redirect-to'), params={'url': url}) self.assertEqual(r.status_code, 200) def test_transport_adapter_ordering(self): -- 2.34.1