aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_server.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-03-25 09:20:26 +1300
committerAldo Cortesi <aldo@nullcube.com>2013-03-25 09:20:26 +1300
commite3fd0e838d67d2e73176a7650d371b6ab59333e0 (patch)
tree8cd51143da16b6fad3e34dfc8e23a43582e38cbd /test/test_server.py
parent98e4421a90854ef3462377909904c8397f107c43 (diff)
downloadmitmproxy-e3fd0e838d67d2e73176a7650d371b6ab59333e0.tar.gz
mitmproxy-e3fd0e838d67d2e73176a7650d371b6ab59333e0.tar.bz2
mitmproxy-e3fd0e838d67d2e73176a7650d371b6ab59333e0.zip
Add a basic built-in web app.
Diffstat (limited to 'test/test_server.py')
-rw-r--r--test/test_server.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/test_server.py b/test/test_server.py
index f12fbcee..c20b0cea 100644
--- a/test/test_server.py
+++ b/test/test_server.py
@@ -53,7 +53,16 @@ class CommonMixin:
assert "Bad Request" in t.rfile.readline()
-class TestHTTP(tservers.HTTPProxTest, CommonMixin):
+
+class AppMixin:
+ def test_app(self):
+ ret = self.app("/")
+ assert ret.status_code == 200
+ assert "mitmproxy" in ret.content
+
+
+
+class TestHTTP(tservers.HTTPProxTest, CommonMixin, AppMixin):
def test_app_err(self):
p = self.pathoc()
ret = p.request("get:'http://errapp/'")
@@ -135,6 +144,7 @@ class TestHTTP(tservers.HTTPProxTest, CommonMixin):
assert req.status_code == 400
+
class TestHTTPAuth(tservers.HTTPProxTest):
authenticator = http_auth.BasicProxyAuth(http_auth.PassManSingleUser("test", "test"), "realm")
def test_auth(self):