aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_pathod.py8
-rw-r--r--test/tutils.py5
2 files changed, 12 insertions, 1 deletions
diff --git a/test/test_pathod.py b/test/test_pathod.py
index 0463fc55..665ef843 100644
--- a/test/test_pathod.py
+++ b/test/test_pathod.py
@@ -52,6 +52,14 @@ class TestNoApi(tutils.DaemonTests):
assert not "Log" in r.content
+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
+
+
class TestNohang(tutils.DaemonTests):
nohang = True
def test_nohang(self):
diff --git a/test/tutils.py b/test/tutils.py
index 580174d9..59649053 100644
--- a/test/tutils.py
+++ b/test/tutils.py
@@ -1,6 +1,6 @@
import tempfile, os, shutil
from contextlib import contextmanager
-from libpathod import utils, test, pathoc
+from libpathod import utils, test, pathoc, pathod
import requests
class DaemonTests:
@@ -10,12 +10,15 @@ class DaemonTests:
ssl = False
timeout = None
hexdump = False
+ not_after_connect = False
@classmethod
def setUpAll(self):
+ so = pathod.SSLOptions(not_after_connect = self.not_after_connect)
self.d = test.Daemon(
staticdir=test_data.path("data"),
anchors=[("/anchor/.*", "202:da")],
ssl = self.ssl,
+ ssloptions = so,
sizelimit=1*1024*1024,
noweb = self.noweb,
noapi = self.noapi,