Test cases fail when `HTTPBIN_URL` does not have trailing slash
authorDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 23 Jul 2013 06:13:00 +0000 (15:13 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 23 Jul 2013 06:29:36 +0000 (15:29 +0900)
Test cases can be run against a local httpbin server defined by
the `HTTPBIN_URL` environment variable, but it causes tests to
fail if the given URL does not end with a slash.

Ensure that the URL always ends with a slash.

test_requests.py

index f2b633b5f04b61e4626bad66d3949bf66f6e323d..3779e36544394d64a18e961a117359a2c4da086f 100755 (executable)
@@ -23,6 +23,8 @@ except ImportError:
     import io as StringIO
 
 HTTPBIN = os.environ.get('HTTPBIN_URL', 'http://httpbin.org/')
+# Issue #1483: Make sure the URL always has a trailing slash
+HTTPBIN = HTTPBIN.rstrip('/') + '/'
 
 
 def httpbin(*suffix):