From 915bcfbd305d7b18de07f4f40dab1e49a06b132c Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 1 Oct 2012 12:01:02 +1300 Subject: Add timeout argument to Pathod, and matching -t command-line option. --- test/test_pathod.py | 9 +++++++++ test/tutils.py | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_pathod.py b/test/test_pathod.py index 9c205d4f..429c2ef9 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -34,6 +34,15 @@ class TestNoWeb(tutils.DaemonTests): assert self.getpath("/").status_code == 800 +class TestTimeout(tutils.DaemonTests): + timeout = 0.1 + def test_noweb(self): + # FIXME: Add float values to spec language, reduce test timeout to + # increase test performance + assert self.get("200:p1,1").status_code == 200 + assert self.d.last_log()["type"] == "timeout" + + class TestNoApi(tutils.DaemonTests): noapi = True def test_noapi(self): diff --git a/test/tutils.py b/test/tutils.py index 60f2ffc0..8e7bca20 100644 --- a/test/tutils.py +++ b/test/tutils.py @@ -8,6 +8,7 @@ class DaemonTests: noapi = False nohang = False ssl = False + timeout = None @classmethod def setUpAll(self): self.d = test.Daemon( @@ -17,7 +18,8 @@ class DaemonTests: sizelimit=1*1024*1024, noweb = self.noweb, noapi = self.noapi, - nohang = self.nohang + nohang = self.nohang, + timeout = self.timeout, ) @classmethod -- cgit v1.2.3