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.
This commit is contained in:
Andrei Zeliankou
2023-05-29 16:45:49 +01:00
parent f55818059c
commit 31ff94add9
24 changed files with 340 additions and 341 deletions

View File

@@ -37,14 +37,11 @@ class TestRewrite(TestApplicationProto):
'routes',
)
def test_rewrite(self):
def test_rewrite(self, findall, wait_for_record):
assert self.get()['status'] == 200
assert (
self.wait_for_record(rf'\[notice\].*"routes/1" selected')
is not None
)
assert len(self.findall(rf'\[notice\].*URI rewritten to "/new"')) == 1
assert len(self.findall(rf'\[notice\].*URI rewritten')) == 1
assert wait_for_record(rf'\[notice\].*"routes/1" selected') is not None
assert len(findall(rf'\[notice\].*URI rewritten to "/new"')) == 1
assert len(findall(rf'\[notice\].*URI rewritten')) == 1
self.set_rewrite("", "")
assert self.get()['status'] == 200