aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_pathoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_pathoc.py')
-rw-r--r--test/test_pathoc.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/test_pathoc.py b/test/test_pathoc.py
new file mode 100644
index 00000000..c6128e22
--- /dev/null
+++ b/test/test_pathoc.py
@@ -0,0 +1,27 @@
+import json
+from libpathod import pathoc, test, version
+import tutils
+
+
+
+class TestDaemon:
+ @classmethod
+ def setUpAll(self):
+ self.d = test.Daemon(
+ staticdir=tutils.test_data.path("data"),
+ anchors=[("/anchor/.*", "202")]
+ )
+
+ @classmethod
+ def tearDownAll(self):
+ self.d.shutdown()
+
+ def setUp(self):
+ self.d.clear_log()
+
+ def test_info(self):
+ c = pathoc.Pathoc("127.0.0.1", self.d.port)
+ c.connect()
+ _, _, _, _, content = c.request("get:/api/info")
+ assert tuple(json.loads(content)["version"]) == version.IVERSION
+