aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_test.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-06-07 11:23:23 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-06-07 11:23:23 +1200
commit14b2a69d2119d8b9d0260aa31190fc7869b45e05 (patch)
treec60d2ccfe7ca32a73b4c3847bff937ba89c1c001 /test/test_test.py
parentb5a74a26ee6548b493cdece5a05f4fcba71c0012 (diff)
downloadmitmproxy-14b2a69d2119d8b9d0260aa31190fc7869b45e05.tar.gz
mitmproxy-14b2a69d2119d8b9d0260aa31190fc7869b45e05.tar.bz2
mitmproxy-14b2a69d2119d8b9d0260aa31190fc7869b45e05.zip
Start building a Pathod unit testing truss.
- Add test.py, which will house the testing API. - Extend API with a shutdown method, used to terminate the test daemon. - Refactor to allow clean shutdown.
Diffstat (limited to 'test/test_test.py')
-rw-r--r--test/test_test.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_test.py b/test/test_test.py
new file mode 100644
index 00000000..6e80dd77
--- /dev/null
+++ b/test/test_test.py
@@ -0,0 +1,21 @@
+import time
+import libpry
+import requests
+from libpathod import test
+
+
+class uDaemon(libpry.AutoTree):
+ def test_startstop(self):
+ d = test.Daemon()
+ rsp = requests.get("http://localhost:%s/p/202"%d.port)
+ assert rsp.ok
+ assert rsp.status_code == 202
+ d.shutdown()
+ rsp = requests.get("http://localhost:%s/p/202"%d.port)
+ assert not rsp.ok
+
+
+
+tests = [
+ uDaemon()
+]