From 7e54de24550df658690277839cbee99c9afe4bc8 Mon Sep 17 00:00:00 2001 From: Paul Tremberth Date: Wed, 7 Dec 2016 18:41:24 +0100 Subject: [PATCH] Add tests for shell command with and without --no-redirect --- tests/test_command_shell.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_command_shell.py b/tests/test_command_shell.py index 7bb7439d6..ee6e8ad8e 100644 --- a/tests/test_command_shell.py +++ b/tests/test_command_shell.py @@ -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')