diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2023-05-29 16:45:49 +0100 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2023-05-29 16:45:49 +0100 |
commit | 31ff94add9c4043a753683d9e8b68733c69aa1ac (patch) | |
tree | 1737c36a2641129a4de775c6058cc07b9cdca0f6 /test/test_asgi_lifespan.py | |
parent | f55818059c01ff9e61bee8107ed1389fe272a787 (diff) | |
download | unit-31ff94add9c4043a753683d9e8b68733c69aa1ac.tar.gz unit-31ff94add9c4043a753683d9e8b68733c69aa1ac.tar.bz2 |
Tests: more fixtures.
Common methods from applications/proto.py converted to the fixtures.
sysctl check moved to the specific file where it is using.
Some options moved to the constructor to have early access.
Diffstat (limited to '')
-rw-r--r-- | test/test_asgi_lifespan.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/test_asgi_lifespan.py b/test/test_asgi_lifespan.py index 84e9fea4..d3ac1721 100644 --- a/test/test_asgi_lifespan.py +++ b/test/test_asgi_lifespan.py @@ -98,27 +98,27 @@ class TestASGILifespan(TestApplicationPython): self.assert_cookies('') self.assert_cookies('app2_') - def test_asgi_lifespan_failed(self): + def test_asgi_lifespan_failed(self, wait_for_record): self.load('lifespan/failed') assert self.get()['status'] == 503 assert ( - self.wait_for_record(r'\[error\].*Application startup failed') + wait_for_record(r'\[error\].*Application startup failed') is not None ), 'error message' - assert self.wait_for_record(r'Exception blah') is not None, 'exception' + assert wait_for_record(r'Exception blah') is not None, 'exception' - def test_asgi_lifespan_error(self): + def test_asgi_lifespan_error(self, wait_for_record): self.load('lifespan/error') self.get() - assert self.wait_for_record(r'Exception blah') is not None, 'exception' + assert wait_for_record(r'Exception blah') is not None, 'exception' - def test_asgi_lifespan_error_auto(self): + def test_asgi_lifespan_error_auto(self, wait_for_record): self.load('lifespan/error_auto') self.get() - assert self.wait_for_record(r'AssertionError') is not None, 'assertion' + assert wait_for_record(r'AssertionError') is not None, 'assertion' |