diff options
author | Andrey Zelenkov <zelenkov@nginx.com> | 2019-04-09 20:59:35 +0300 |
---|---|---|
committer | Andrey Zelenkov <zelenkov@nginx.com> | 2019-04-09 20:59:35 +0300 |
commit | 29b4e4431fe43f9ac969a1cdb67478da8c5dcc1e (patch) | |
tree | f1b8944daa883776d672e3ffb7d37009f0004462 /test/test_python_application.py | |
parent | 549f0873c2beed9517fb4006e1f0a63e0019abb3 (diff) | |
download | unit-29b4e4431fe43f9ac969a1cdb67478da8c5dcc1e.tar.gz unit-29b4e4431fe43f9ac969a1cdb67478da8c5dcc1e.tar.bz2 |
Tests: speed up tests.
Diffstat (limited to '')
-rw-r--r-- | test/test_python_application.py | 15 |
1 files changed, 15 insertions, 0 deletions
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( |