diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-07-30 17:29:36 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-07-30 17:29:36 +1200 |
commit | e52a37ffa962f662cfcab8056c8af5b0ac9f416b (patch) | |
tree | a7d9f4edf1080422edd19f1360298e914628e675 /.sources/examples_test.py | |
parent | e26aac1d3c6e4ca9f09cffa9d61d5a632dc35f14 (diff) | |
download | mitmproxy-e52a37ffa962f662cfcab8056c8af5b0ac9f416b.tar.gz mitmproxy-e52a37ffa962f662cfcab8056c8af5b0ac9f416b.tar.bz2 mitmproxy-e52a37ffa962f662cfcab8056c8af5b0ac9f416b.zip |
Cleanup of libpathod.test, test example for front page.
Diffstat (limited to '.sources/examples_test.py')
-rw-r--r-- | .sources/examples_test.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.sources/examples_test.py b/.sources/examples_test.py new file mode 100644 index 00000000..1f2630e0 --- /dev/null +++ b/.sources/examples_test.py @@ -0,0 +1,17 @@ +import requests +from libpathod import test + +class Test: + def setUp(self): + self.daemon = test.Daemon() + + def tearDown(self): + self.daemon.shutdown() + + def test_simple(self): + path = self.daemon.p("200:b@100") + r = requests.get(path) + assert r.status_code == 200 + assert len(r.content) == 100 + log = self.daemon.last_log() + assert log["request"]["method"] == "GET" |