aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_pathoc.py12
-rw-r--r--test/test_pathod.py16
2 files changed, 14 insertions, 14 deletions
diff --git a/test/test_pathoc.py b/test/test_pathoc.py
index 2c86df11..52a1b5ee 100644
--- a/test/test_pathoc.py
+++ b/test/test_pathoc.py
@@ -26,8 +26,8 @@ class _TestDaemon:
ssl = self.ssl
)
c.connect()
- _, _, _, _, content = c.request("get:/api/info")
- assert tuple(json.loads(content)["version"]) == version.IVERSION
+ r = c.request("get:/api/info")
+ assert tuple(json.loads(r.content)["version"]) == version.IVERSION
class TestDaemonSSL(_TestDaemon):
@@ -41,8 +41,8 @@ class TestDaemonSSL(_TestDaemon):
)
c.connect()
c.request("get:/p/200")
- _, _, _, _, content = c.request("get:/api/log")
- d = json.loads(content)
+ r = c.request("get:/api/log")
+ d = json.loads(r.content)
assert d["log"][0]["request"]["sni"] == "foobar.com"
def test_clientcert(self):
@@ -54,8 +54,8 @@ class TestDaemonSSL(_TestDaemon):
)
c.connect()
c.request("get:/p/200")
- _, _, _, _, content = c.request("get:/api/log")
- d = json.loads(content)
+ r = c.request("get:/api/log")
+ d = json.loads(r.content)
assert d["log"][0]["request"]["clientcert"]["keyinfo"]
diff --git a/test/test_pathod.py b/test/test_pathod.py
index 412d1031..9cd90e94 100644
--- a/test/test_pathod.py
+++ b/test/test_pathod.py
@@ -56,8 +56,8 @@ class TestNotAfterConnect(tutils.DaemonTests):
ssl = False
not_after_connect = True
def test_connect(self):
- v = self.pathoc(r"get:'http://foo.com/p/202':da", connect_to=("localhost", self.d.port))
- assert v[1] == 202
+ r = self.pathoc(r"get:'http://foo.com/p/202':da", connect_to=("localhost", self.d.port))
+ assert r.status_code == 202
class TestNohang(tutils.DaemonTests):
@@ -88,8 +88,8 @@ class CommonTests(tutils.DaemonTests):
assert "too large" in l["msg"]
def test_preline(self):
- v = self.pathoc(r"get:'/p/200':i0,'\r\n'")
- assert v[1] == 200
+ r = self.pathoc(r"get:'/p/200':i0,'\r\n'")
+ assert r.status_code == 200
def test_info(self):
assert tuple(self.d.info()["version"]) == version.IVERSION
@@ -152,15 +152,15 @@ class CommonTests(tutils.DaemonTests):
assert "File access denied" in rsp.content
def test_proxy(self):
- v = self.pathoc(r"get:'http://foo.com/p/202':da")
- assert v[1] == 202
+ r = self.pathoc(r"get:'http://foo.com/p/202':da")
+ assert r.status_code == 202
class TestDaemon(CommonTests):
ssl = False
def test_connect(self):
- v = self.pathoc(r"get:'http://foo.com/p/202':da", connect_to=("localhost", self.d.port), ssl=True)
- assert v[1] == 202
+ r = self.pathoc(r"get:'http://foo.com/p/202':da", connect_to=("localhost", self.d.port), ssl=True)
+ assert r.status_code == 202
def test_connect_err(self):
tutils.raises(http.HttpError, self.pathoc, r"get:'http://foo.com/p/202':da", connect_to=("localhost", self.d.port))