Add tests for shell command with and without --no-redirect

This commit is contained in:
Paul Tremberth 2016-12-07 18:41:24 +01:00
parent 778bed07bf
commit 7e54de2455
1 changed files with 10 additions and 0 deletions

View File

@ -49,6 +49,16 @@ class ShellTest(ProcessTest, SiteTest, unittest.TestCase):
_, out, _ = yield self.execute([self.url('/redirect'), '-c', 'response.url'])
assert out.strip().endswith(b'/redirected')
@defer.inlineCallbacks
def test_redirect_follow_302(self):
_, out, _ = yield self.execute([self.url('/redirect-no-meta-refresh'), '-c', 'response.status'])
assert out.strip().endswith(b'200')
@defer.inlineCallbacks
def test_redirect_not_follow_302(self):
_, out, _ = yield self.execute(['--no-redirect', self.url('/redirect-no-meta-refresh'), '-c', 'response.status'])
assert out.strip().endswith(b'302')
@defer.inlineCallbacks
def test_request_replace(self):
url = self.url('/text')