From e52a37ffa962f662cfcab8056c8af5b0ac9f416b Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 30 Jul 2012 17:29:36 +1200 Subject: Cleanup of libpathod.test, test example for front page. --- libpathod/templates/examples_test.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 libpathod/templates/examples_test.html (limited to 'libpathod/templates/examples_test.html') diff --git a/libpathod/templates/examples_test.html b/libpathod/templates/examples_test.html new file mode 100644 index 00000000..57d39534 --- /dev/null +++ b/libpathod/templates/examples_test.html @@ -0,0 +1,18 @@ +
import requests
+from libpathod import test
+
+class Test:
+    def setUp(self):
+        self.daemon = test.Daemon()
+
+    def tearDown(self):
+        self.daemon.shutdown()
+
+    def test_simple(self):
+        path = self.daemon.p("200:b@100")
+        r = requests.get(path)
+        assert r.status_code == 200
+        assert len(r.content) == 100
+        log = self.daemon.last_log()
+        assert log["request"]["method"] == "GET"
+
-- cgit v1.2.3