From 48da24ae7e7be7af94162d35a463f174e22504f6 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 5 Jun 2016 13:04:13 +1200 Subject: First-order removal of pathod API and app --- test/pathod/test_app.py | 82 ----------------------------- test/pathod/test_pathoc.py | 125 ++++++++++++++++----------------------------- test/pathod/test_pathod.py | 10 ---- 3 files changed, 43 insertions(+), 174 deletions(-) delete mode 100644 test/pathod/test_app.py (limited to 'test/pathod') diff --git a/test/pathod/test_app.py b/test/pathod/test_app.py deleted file mode 100644 index 19888c75..00000000 --- a/test/pathod/test_app.py +++ /dev/null @@ -1,82 +0,0 @@ -import tutils - - -class TestApp(tutils.DaemonTests): - SSL = False - - def test_index(self): - r = self.getpath("/") - assert r.status_code == 200 - assert r.content - - def test_about(self): - r = self.getpath("/about") - assert r.status_code == 200 - - def test_download(self): - r = self.getpath("/download") - assert r.status_code == 200 - - def test_docs(self): - assert self.getpath("/docs/pathod").status_code == 200 - assert self.getpath("/docs/pathoc").status_code == 200 - assert self.getpath("/docs/language").status_code == 200 - assert self.getpath("/docs/pathod").status_code == 200 - assert self.getpath("/docs/test").status_code == 200 - - def test_log(self): - assert self.getpath("/log").status_code == 200 - assert self.get("200:da").status_code == 200 - id = self.d.expect_log(1)[0]["id"] - assert self.getpath("/log").status_code == 200 - assert self.getpath("/log/%s" % id).status_code == 200 - assert self.getpath("/log/9999999").status_code == 404 - - def test_response_preview(self): - r = self.getpath("/response_preview", params=dict(spec="200")) - assert r.status_code == 200 - assert 'Response' in r.content - - r = self.getpath("/response_preview", params=dict(spec="foo")) - assert r.status_code == 200 - assert 'Error' in r.content - - r = self.getpath("/response_preview", params=dict(spec="200:b@100m")) - assert r.status_code == 200 - assert "too large" in r.content - - r = self.getpath("/response_preview", params=dict(spec="200:b@5k")) - assert r.status_code == 200 - assert 'Response' in r.content - - r = self.getpath( - "/response_preview", - params=dict( - spec="200:b Date: Sun, 5 Jun 2016 13:24:46 +1200 Subject: Remove last vestiges of noapi and noweb from pathod Also hide HTTP2 freeze bug by making explain configurable in the tests --- test/pathod/test_pathoc.py | 1 + test/pathod/test_pathod.py | 12 +----------- test/pathod/tutils.py | 10 +++------- 3 files changed, 5 insertions(+), 18 deletions(-) (limited to 'test/pathod') diff --git a/test/pathod/test_pathoc.py b/test/pathod/test_pathoc.py index a88cfa91..8b69a2a6 100644 --- a/test/pathod/test_pathoc.py +++ b/test/pathod/test_pathoc.py @@ -228,6 +228,7 @@ class TestDaemon(PathocTestDaemon): class TestDaemonHTTP2(PathocTestDaemon): ssl = True + explain = False if tcp.HAS_ALPN: diff --git a/test/pathod/test_pathod.py b/test/pathod/test_pathod.py index f64b0f61..0bbad6c2 100644 --- a/test/pathod/test_pathod.py +++ b/test/pathod/test_pathod.py @@ -23,18 +23,10 @@ class TestPathod(object): assert len(p.get_log()) <= p.LOGBUF -class TestNoWeb(tutils.DaemonTests): - noweb = True - - def test_noweb(self): - assert self.get("200:da").status_code == 200 - assert self.getpath("/").status_code == 800 - - class TestTimeout(tutils.DaemonTests): timeout = 0.01 - def test_noweb(self): + def test_timeout(self): # FIXME: Add float values to spec language, reduce test timeout to # increase test performance # This is a bodge - we have some platform difference that causes @@ -261,8 +253,6 @@ class TestDaemonSSL(CommonTests): class TestHTTP2(tutils.DaemonTests): ssl = True - noweb = True - noapi = True nohang = True if tcp.HAS_ALPN: diff --git a/test/pathod/tutils.py b/test/pathod/tutils.py index 1a883c93..56cd2002 100644 --- a/test/pathod/tutils.py +++ b/test/pathod/tutils.py @@ -24,14 +24,13 @@ def treader(bytes): class DaemonTests(object): - noweb = False - noapi = False nohang = False ssl = False timeout = None hexdump = False ssloptions = None nocraft = False + explain = True @classmethod def setup_class(cls): @@ -47,15 +46,13 @@ class DaemonTests(object): ssl=cls.ssl, ssloptions=so, sizelimit=1 * 1024 * 1024, - noweb=cls.noweb, - noapi=cls.noapi, nohang=cls.nohang, timeout=cls.timeout, hexdump=cls.hexdump, nocraft=cls.nocraft, logreq=True, logresp=True, - explain=True + explain=cls.explain ) @classmethod @@ -65,8 +62,7 @@ class DaemonTests(object): def teardown(self): self.d.wait_for_silence() - if not (self.noweb or self.noapi): - self.d.clear_log() + self.d.clear_log() def _getpath(self, path, params=None): scheme = "https" if self.ssl else "http" -- cgit v1.2.3