summaryrefslogtreecommitdiffhomepage
path: root/test/test_status.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-05-25 16:56:14 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2023-05-25 16:56:14 +0100
commitb034bf67034c4f0e966ebd207ba2f407f6f15fa8 (patch)
treeed2f338b2283b2b4d4ec562ab7e251268ac3f0fa /test/test_status.py
parent0132e552d0b9e8b724015728b5fbd7dad9d2edcb (diff)
downloadunit-b034bf67034c4f0e966ebd207ba2f407f6f15fa8.tar.gz
unit-b034bf67034c4f0e966ebd207ba2f407f6f15fa8.tar.bz2
Tests: assertion related fixes.
Diffstat (limited to '')
-rw-r--r--test/test_status.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test_status.py b/test/test_status.py
index 8a00002b..f8885dff 100644
--- a/test/test_status.py
+++ b/test/test_status.py
@@ -9,7 +9,7 @@ class TestStatus(TestApplicationPython):
prerequisites = {'modules': {'python': 'any'}}
def check_connections(self, accepted, active, idle, closed):
- Status.get('/connections') == {
+ assert Status.get('/connections') == {
'accepted': accepted,
'active': active,
'idle': idle,
@@ -112,7 +112,12 @@ Connection: close
# idle
- sock = self.http(b'', raw=True, no_recv=True)
+ (_, sock) = self.get(
+ headers={'Host': 'localhost', 'Connection': 'keep-alive'},
+ start=True,
+ read_timeout=1,
+ )
+
self.check_connections(2, 0, 1, 1)
self.get(sock=sock)
@@ -141,7 +146,7 @@ Connection: close
assert apps == expert.sort()
def check_application(name, running, starting, idle, active):
- Status.get(f'/applications/{name}') == {
+ assert Status.get(f'/applications/{name}') == {
'processes': {
'running': running,
'starting': starting,