From d33d3663ecb166461d9cb5a78a29b44ee7a8fbb7 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 18 Feb 2016 13:03:40 +0100 Subject: combine projects --- pathod/templates/examples_setup.html | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pathod/templates/examples_setup.html (limited to 'pathod/templates/examples_setup.html') diff --git a/pathod/templates/examples_setup.html b/pathod/templates/examples_setup.html new file mode 100644 index 00000000..b8419171 --- /dev/null +++ b/pathod/templates/examples_setup.html @@ -0,0 +1,32 @@ +
import requests
+from pathod import test
+
+
+class Test:
+
+    """
+        Testing the requests module with
+        a pathod instance started for
+        each test.
+    """
+
+    def setUp(self):
+        self.d = test.Daemon()
+
+    def tearDown(self):
+        self.d.shutdown()
+
+    def test_simple(self):
+        # Get a URL for a pathod spec
+        url = self.d.p("200:b@100")
+        # ... and request it
+        r = requests.put(url)
+
+        # Check the returned data
+        assert r.status_code == 200
+        assert len(r.content) == 100
+
+        # Check pathod's internal log
+        log = self.d.last_log()["request"]
+        assert log["method"] == "PUT"
+
-- cgit v1.2.3