aboutsummaryrefslogtreecommitdiffstats
path: root/test/pathod/test_pathod.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/pathod/test_pathod.py')
-rw-r--r--test/pathod/test_pathod.py34
1 files changed, 12 insertions, 22 deletions
diff --git a/test/pathod/test_pathod.py b/test/pathod/test_pathod.py
index 05a3962e..ec9c169f 100644
--- a/test/pathod/test_pathod.py
+++ b/test/pathod/test_pathod.py
@@ -1,8 +1,7 @@
from six.moves import cStringIO as StringIO
-import pytest
-from pathod import pathod, version
-from netlib import tcp, http
+from pathod import pathod
+from netlib import tcp
from netlib.exceptions import HttpException, TlsException
import tutils
@@ -51,7 +50,7 @@ class TestNoApi(tutils.DaemonTests):
assert self.getpath("/log").status_code == 404
r = self.getpath("/")
assert r.status_code == 200
- assert not "Log" in r.content
+ assert "Log" not in r.content
class TestNotAfterConnect(tutils.DaemonTests):
@@ -110,7 +109,7 @@ class TestHexdump(tutils.DaemonTests):
hexdump = True
def test_hexdump(self):
- r = self.get(r"200:b'\xf0'")
+ assert self.get(r"200:b'\xf0'")
class TestNocraft(tutils.DaemonTests):
@@ -125,11 +124,10 @@ class TestNocraft(tutils.DaemonTests):
class CommonTests(tutils.DaemonTests):
def test_binarydata(self):
- r = self.get(r"200:b'\xf0'")
- l = self.d.last_log()
+ assert self.get(r"200:b'\xf0'")
+ assert self.d.last_log()
# FIXME: Other binary data elements
- @pytest.mark.skip(reason="race condition")
def test_sizelimit(self):
r = self.get("200:b@1g")
assert r.status_code == 800
@@ -140,21 +138,15 @@ class CommonTests(tutils.DaemonTests):
r, _ = self.pathoc([r"get:'/p/200':i0,'\r\n'"])
assert r[0].status_code == 200
- def test_info(self):
- assert tuple(self.d.info()["version"]) == version.IVERSION
-
- @pytest.mark.skip(reason="race condition")
def test_logs(self):
- assert self.d.clear_log()
- assert not self.d.last_log()
- rsp = self.get("202:da")
- assert len(self.d.log()) == 1
- assert self.d.clear_log()
+ self.d.clear_log()
+ assert self.get("202:da")
+ assert self.d.expect_log(1)
+ self.d.clear_log()
assert len(self.d.log()) == 0
def test_disconnect(self):
- rsp = self.get("202:b@100k:d200")
- assert len(rsp.content) < 200
+ tutils.raises("unexpected eof", self.get, "202:b@100k:d200")
def test_parserr(self):
rsp = self.get("400:msg,b:")
@@ -166,7 +158,7 @@ class CommonTests(tutils.DaemonTests):
assert rsp.content.strip() == "testfile"
def test_anchor(self):
- rsp = self.getpath("anchor/foo")
+ rsp = self.getpath("/anchor/foo")
assert rsp.status_code == 202
def test_invalid_first_line(self):
@@ -223,7 +215,6 @@ class CommonTests(tutils.DaemonTests):
)
assert r[1].payload == "test"
- @pytest.mark.skip(reason="race condition")
def test_websocket_frame_reflect_error(self):
r, _ = self.pathoc(
["ws:/p/", "wf:-mask:knone:f'wf:b@10':i13,'a'"],
@@ -233,7 +224,6 @@ class CommonTests(tutils.DaemonTests):
# FIXME: Race Condition?
assert "Parse error" in self.d.text_log()
- @pytest.mark.skip(reason="race condition")
def test_websocket_frame_disconnect_error(self):
self.pathoc(["ws:/p/", "wf:b@10:d3"], ws_read_limit=0)
assert self.d.last_log()