From b034bf67034c4f0e966ebd207ba2f407f6f15fa8 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Thu, 25 May 2023 16:56:14 +0100 Subject: Tests: assertion related fixes. --- test/test_status.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'test/test_status.py') 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, -- cgit