summaryrefslogtreecommitdiffhomepage
path: root/test/test_go_application.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-05-29 16:45:49 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2023-05-29 16:45:49 +0100
commit31ff94add9c4043a753683d9e8b68733c69aa1ac (patch)
tree1737c36a2641129a4de775c6058cc07b9cdca0f6 /test/test_go_application.py
parentf55818059c01ff9e61bee8107ed1389fe272a787 (diff)
downloadunit-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 'test/test_go_application.py')
-rw-r--r--test/test_go_application.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/test_go_application.py b/test/test_go_application.py
index 880a617a..062d0cb5 100644
--- a/test/test_go_application.py
+++ b/test/test_go_application.py
@@ -11,7 +11,7 @@ class TestGoApplication(TestApplicationGo):
def setup_method_fixture(self, skip_alert):
skip_alert(r'\[unit\] close\(\d+\) failed: Bad file descriptor')
- def test_go_application_variables(self):
+ def test_go_application_variables(self, date_to_sec_epoch, sec_epoch):
self.load('variables')
body = 'Test body string.'
@@ -33,9 +33,7 @@ class TestGoApplication(TestApplicationGo):
date = headers.pop('Date')
assert date[-4:] == ' GMT', 'date header timezone'
- assert (
- abs(self.date_to_sec_epoch(date) - self.sec_epoch()) < 5
- ), 'date header'
+ assert abs(date_to_sec_epoch(date) - sec_epoch) < 5, 'date header'
assert headers == {
'Content-Length': str(len(body)),