mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
tests: use httpbin for redirect tests
This commit is contained in:
parent
61ce53a0e0
commit
f14f37d5b1
@ -105,10 +105,10 @@ def test_example_1():
|
|||||||
assert '/pywb/20131226101010/http://www.iana.org/domains/example' in buff, buff
|
assert '/pywb/20131226101010/http://www.iana.org/domains/example' in buff, buff
|
||||||
|
|
||||||
def test_example_2_redirect():
|
def test_example_2_redirect():
|
||||||
status_headers, buff = get_rewritten('http://facebook.com/', urlrewriter)
|
status_headers, buff = get_rewritten('http://httpbin.org/redirect-to?url=http://example.com/', urlrewriter)
|
||||||
|
|
||||||
# redirect, no content
|
# redirect, no content
|
||||||
assert status_headers.get_statuscode() == '301'
|
assert status_headers.get_statuscode() == '302'
|
||||||
assert len(buff) == 0
|
assert len(buff) == 0
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ class TestLiveRewriter:
|
|||||||
assert resp.status_int == 200
|
assert resp.status_int == 200
|
||||||
|
|
||||||
def test_live_rewrite_redirect_2(self):
|
def test_live_rewrite_redirect_2(self):
|
||||||
resp = self.testapp.get('/rewrite/http://facebook.com/')
|
resp = self.testapp.get('/rewrite/http://httpbin.org/redirect-to?url=http://example.com/')
|
||||||
assert resp.status_int == 301
|
assert resp.status_int == 302
|
||||||
|
|
||||||
def test_live_rewrite_post(self):
|
def test_live_rewrite_post(self):
|
||||||
resp = self.testapp.post('/rewrite/httpbin.org/post', {'foo': 'bar', 'test': 'abc'})
|
resp = self.testapp.post('/rewrite/httpbin.org/post', {'foo': 'bar', 'test': 'abc'})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user