diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-01-07 02:29:10 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-01-07 02:29:10 +0100 |
commit | ea2f17680b964e2e793ff804a6f4e7b9d2d7b1ac (patch) | |
tree | 84250064ffbebb2974849d083d0129e545848862 /test/test_flow.py | |
parent | b34ad82b528b55dabc318f999577fb6a020ccad9 (diff) | |
parent | d5f9b02615bffe56639a7250f31752cebd2b8d62 (diff) | |
download | mitmproxy-ea2f17680b964e2e793ff804a6f4e7b9d2d7b1ac.tar.gz mitmproxy-ea2f17680b964e2e793ff804a6f4e7b9d2d7b1ac.tar.bz2 mitmproxy-ea2f17680b964e2e793ff804a6f4e7b9d2d7b1ac.zip |
continue work on the proxyhandler
Diffstat (limited to 'test/test_flow.py')
-rw-r--r-- | test/test_flow.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_flow.py b/test/test_flow.py index c614960b..bf6a7a42 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -5,6 +5,27 @@ from libmproxy import filt, flow, controller, utils, tnetstring, proxy import tutils +def test_app_registry(): + ar = flow.AppRegistry() + ar.add("foo", "domain", 80) + + r = tutils.treq() + r.host = "domain" + r.port = 80 + assert ar.get(r) + + r.port = 81 + assert not ar.get(r) + + r = tutils.treq() + r.host = "domain2" + r.port = 80 + assert not ar.get(r) + r.headers["host"] = ["domain"] + assert ar.get(r) + + + class TestStickyCookieState: def _response(self, cookie, host): s = flow.StickyCookieState(filt.parse(".*")) |