From 39008c1f05b30e9ac51cf7c46743c9d2dc34f505 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Mon, 21 Sep 2020 21:24:42 +0100 Subject: Tests: added test for "idle_timeout" with empty payload. --- test/test_settings.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/test_settings.py b/test/test_settings.py index 59b4a048..797af5ed 100644 --- a/test/test_settings.py +++ b/test/test_settings.py @@ -203,6 +203,24 @@ Connection: close assert resp['status'] == 408, 'status idle timeout' + def test_settings_idle_timeout_2(self): + self.load('empty') + + assert self.get()['status'] == 200, 'init' + + self.conf({'http': {'idle_timeout': 1}}, 'settings') + + _, sock = self.http(b'', start=True, raw=True, no_recv=True) + + time.sleep(2) + + assert ( + self.get( + headers={'Host': 'localhost', 'Connection': 'close'}, sock=sock + )['status'] + == 408 + ), 'status idle timeout' + def test_settings_max_body_size(self): self.load('empty') -- cgit