aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_pathod.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_pathod.py')
-rw-r--r--test/test_pathod.py32
1 files changed, 27 insertions, 5 deletions
diff --git a/test/test_pathod.py b/test/test_pathod.py
index 9ab6d66d..6fc31677 100644
--- a/test/test_pathod.py
+++ b/test/test_pathod.py
@@ -1,3 +1,4 @@
+import pprint
from libpathod import pathod, version
from netlib import tcp, http
import requests
@@ -54,12 +55,26 @@ class TestNoApi(tutils.DaemonTests):
class TestNotAfterConnect(tutils.DaemonTests):
ssl = False
- not_after_connect = True
+ ssloptions = dict(
+ not_after_connect = True
+ )
def test_connect(self):
r = self.pathoc(r"get:'http://foo.com/p/202':da", connect_to=("localhost", self.d.port))
assert r.status_code == 202
+class TestSSLCN(tutils.DaemonTests):
+ ssl = True
+ ssloptions = dict(
+ cn = "foo.com"
+ )
+ def test_connect(self):
+ r = self.pathoc(r"get:/p/202")
+ assert r.status_code == 202
+ assert r.sslinfo
+ assert r.sslinfo.certchain[0].get_subject().CN == "foo.com"
+
+
class TestNohang(tutils.DaemonTests):
nohang = True
def test_nohang(self):
@@ -159,11 +174,20 @@ class CommonTests(tutils.DaemonTests):
class TestDaemon(CommonTests):
ssl = False
def test_connect(self):
- r = self.pathoc(r"get:'http://foo.com/p/202':da", connect_to=("localhost", self.d.port), ssl=True)
+ 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))
+ tutils.raises(
+ http.HttpError,
+ self.pathoc,
+ r"get:'http://foo.com/p/202':da",
+ connect_to=("localhost", self.d.port)
+ )
class TestDaemonSSL(CommonTests):
@@ -182,5 +206,3 @@ class TestDaemonSSL(CommonTests):
assert l["type"] == "error"
assert "SSL" in l["msg"]
-
-