aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_app.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_app.py')
-rw-r--r--test/test_app.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test_app.py b/test/test_app.py
new file mode 100644
index 00000000..f0eab7cc
--- /dev/null
+++ b/test/test_app.py
@@ -0,0 +1,19 @@
+import mock, socket, os, time
+from libmproxy import dump
+from netlib import certutils, tcp
+from libpathod.pathoc import Pathoc
+import tutils, tservers
+
+class TestApp(tservers.HTTPProxTest):
+ def test_basic(self):
+ assert self.app("/").status_code == 200
+
+ def test_cert(self):
+ path = tutils.test_data.path("data/confdir/") + "mitmproxy-ca-cert."
+ with tutils.tmpdir() as d:
+ for ext in ["pem", "p12"]:
+ resp = self.app("/cert/%s" % ext)
+ assert resp.status_code == 200
+ with open(path + ext, "rb") as f:
+ assert resp.content == f.read()
+