From 29b4e4431fe43f9ac969a1cdb67478da8c5dcc1e Mon Sep 17 00:00:00 2001 From: Andrey Zelenkov Date: Tue, 9 Apr 2019 20:59:35 +0300 Subject: Tests: speed up tests. --- test/test_python_application.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/test_python_application.py') diff --git a/test/test_python_application.py b/test/test_python_application.py index d66a6555..6c310ecc 100644 --- a/test/test_python_application.py +++ b/test/test_python_application.py @@ -134,6 +134,8 @@ class TestPythonApplication(TestApplicationPython): def test_python_keepalive_body(self): self.load('mirror') + self.assertEqual(self.get()['status'], 200, 'init') + (resp, sock) = self.post( headers={ 'Host': 'localhost', @@ -142,6 +144,7 @@ class TestPythonApplication(TestApplicationPython): }, start=True, body='0123456789' * 500, + read_timeout=1, ) self.assertEqual(resp['body'], '0123456789' * 500, 'keep-alive 1') @@ -168,6 +171,8 @@ class TestPythonApplication(TestApplicationPython): ) self.load('mirror') + self.assertEqual(self.get()['status'], 200, 'init') + body = '0123456789' conns = 3 socks = [] @@ -181,6 +186,7 @@ class TestPythonApplication(TestApplicationPython): }, start=True, body=body, + read_timeout=1, ) self.assertEqual(resp['body'], body, 'keep-alive open') @@ -202,6 +208,7 @@ class TestPythonApplication(TestApplicationPython): start=True, sock=socks[i], body=body, + read_timeout=1, ) self.assertEqual(resp['body'], body, 'keep-alive request') @@ -232,6 +239,8 @@ class TestPythonApplication(TestApplicationPython): def test_python_keepalive_reconfigure_2(self): self.load('mirror') + self.assertEqual(self.get()['status'], 200, 'init') + body = '0123456789' (resp, sock) = self.post( @@ -242,12 +251,15 @@ class TestPythonApplication(TestApplicationPython): }, start=True, body=body, + read_timeout=1, ) self.assertEqual(resp['body'], body, 'reconfigure 2 keep-alive 1') self.load('empty') + self.assertEqual(self.get()['status'], 200, 'init') + (resp, sock) = self.post( headers={ 'Host': 'localhost', @@ -275,11 +287,14 @@ class TestPythonApplication(TestApplicationPython): def test_python_keepalive_reconfigure_3(self): self.load('empty') + self.assertEqual(self.get()['status'], 200, 'init') + (resp, sock) = self.http( b"""GET / HTTP/1.1 """, start=True, raw=True, + read_timeout=1, ) self.assertIn( -- cgit