Skip to content
Myr

Define some httpbin fixtures.

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

authored by Cory Benfield · committed by Cory Benfield · parent de53523 · Browse files · 1 file+22 added−9 removed
This commit

State

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

Diff stats

1 file+22 added−9 removed

  • other:+22 added−9 removed

1 file+22 added−9 removed

modified:test_requests.py+22 added-9 removed
46 unmodified lines
47 def u(s):48 return s.decode('unicode-escape')495051# Requests to this URL should always fail with a connection timeout (nothing52# listening on that port)53TARPIT = "http://10.255.255.1"54HTTPBIN = os.environ.get('HTTPBIN_URL', 'http://httpbin.org/')55# Issue #1483: Make sure the URL always has a trailing slash56HTTPBIN = HTTPBIN.rstrip('/') + '/'51@pytest.fixture52def httpbin(httpbin):53 # Issue #1483: Make sure the URL always has a trailing slash54 httpbin_url = httpbin.url.rstrip('/') + '/'5556 def inner(*suffix):57 return urljoin(httpbin_url, '/'.join(suffix))5859def httpbin(*suffix):60 """Returns url for HTTPBIN resource."""61 return urljoin(HTTPBIN, '/'.join(suffix))59 return inner606162@pytest.fixture63def httpsbin_url(httpbin_secure):64 # Issue #1483: Make sure the URL always has a trailing slash65 httpbin_url = httpbin_secure.url.rstrip('/') + '/'6667 def inner(*suffix):68 return urljoin(httpbin_url, '/'.join(suffix))6970 return inner717273# Requests to this URL should always fail with a connection timeout (nothing74# listening on that port)75TARPIT = "http://10.255.255.1"7677class RequestsTestCase(unittest.TestCase):7879 _multiprocess_can_split_ = True80
1663 unmodified lines