summaryrefslogtreecommitdiffhomepage
path: root/test/test_python_application.py
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2019-04-09 16:14:42 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2019-04-09 16:14:42 +0300
commit549f0873c2beed9517fb4006e1f0a63e0019abb3 (patch)
treefc77a4c4b93a333b08e7b7d8ff28248bd8f74ba6 /test/test_python_application.py
parentcfcf4da7fab046cf4dad47b499fa44abbc8f62b8 (diff)
downloadunit-549f0873c2beed9517fb4006e1f0a63e0019abb3.tar.gz
unit-549f0873c2beed9517fb4006e1f0a63e0019abb3.tar.bz2
Tests: wait_for_record() introduced.
Diffstat (limited to 'test/test_python_application.py')
-rw-r--r--test/test_python_application.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/test_python_application.py b/test/test_python_application.py
index 0b153d77..d66a6555 100644
--- a/test/test_python_application.py
+++ b/test/test_python_application.py
@@ -127,10 +127,8 @@ class TestPythonApplication(TestApplicationPython):
self.stop()
- time.sleep(0.2)
-
self.assertIsNotNone(
- self.search_in_log(r'RuntimeError'), 'ctx iter atexit'
+ self.wait_for_record(r'RuntimeError'), 'ctx iter atexit'
)
def test_python_keepalive_body(self):
@@ -310,7 +308,9 @@ Connection: close
self.stop()
- self.assertIsNotNone(self.search_in_log(r'At exit called\.'), 'atexit')
+ self.assertIsNotNone(
+ self.wait_for_record(r'At exit called\.'), 'atexit'
+ )
@unittest.expectedFailure
def test_python_application_start_response_exit(self):
@@ -384,7 +384,7 @@ Connection: close
self.stop()
self.assertIsNotNone(
- self.search_in_log(r'\[error\].+Error in application\.'),
+ self.wait_for_record(r'\[error\].+Error in application\.'),
'errors write',
)
@@ -417,7 +417,7 @@ Connection: close
self.stop()
- self.assertIsNotNone(self.search_in_log(r'Close called\.'), 'close')
+ self.assertIsNotNone(self.wait_for_record(r'Close called\.'), 'close')
def test_python_application_close_error(self):
self.load('close_error')
@@ -427,7 +427,7 @@ Connection: close
self.stop()
self.assertIsNotNone(
- self.search_in_log(r'Close called\.'), 'close error'
+ self.wait_for_record(r'Close called\.'), 'close error'
)
def test_python_application_not_iterable(self):
@@ -438,7 +438,7 @@ Connection: close
self.stop()
self.assertIsNotNone(
- self.search_in_log(
+ self.wait_for_record(
r'\[error\].+the application returned not an iterable object'
),
'not iterable',