diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-10-28 14:15:29 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-10-28 14:15:29 +1300 |
commit | e9af434c2bfa439544f4fe48acb8dab581bb0f1b (patch) | |
tree | 57d6ab46ec1957a84774b5e68f476be449d89d89 /test | |
parent | 9d42a06c92f0fdc7ca986b738086d361d9b0599b (diff) | |
download | mitmproxy-e9af434c2bfa439544f4fe48acb8dab581bb0f1b.tar.gz mitmproxy-e9af434c2bfa439544f4fe48acb8dab581bb0f1b.tar.bz2 mitmproxy-e9af434c2bfa439544f4fe48acb8dab581bb0f1b.zip |
.body and .method to lazy generator instantiation.
Also introduce a _Component ABC.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_language.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/test_language.py b/test/test_language.py index 54f96d51..aba67274 100644 --- a/test/test_language.py +++ b/test/test_language.py @@ -324,7 +324,7 @@ class TestParseRequest: p = tutils.test_data.path("data") d = dict(staticdir=p) r = language.parse_request(d, "+request") - assert r.path == "/foo" + assert r.path.values({})[0][:] == "/foo" def test_nonascii(self): tutils.raises("ascii", language.parse_request, {}, "get:\xf0") @@ -334,21 +334,21 @@ class TestParseRequest: def test_simple(self): r = language.parse_request({}, 'GET:"/foo"') - assert r.method == "GET" - assert r.path == "/foo" + assert r.method.string() == "GET" + assert r.path.string() == "/foo" r = language.parse_request({}, 'GET:/foo') - assert r.path == "/foo" + assert r.path.string() == "/foo" r = language.parse_request({}, 'GET:@1k') - assert len(r.path) == 1024 + assert len(r.path.string()) == 1024 def test_render(self): s = cStringIO.StringIO() r = language.parse_request({}, "GET:'/foo'") assert r.serve(s, {}, "foo.com") - def test_str(self): + def test_string(self): r = language.parse_request({}, 'GET:"/foo"') - assert str(r) + assert r.string() def test_multiline(self): l = """ @@ -357,8 +357,8 @@ class TestParseRequest: ir,@1 """ r = language.parse_request({}, l) - assert r.method == "GET" - assert r.path == "/foo" + assert r.method.string() == "GET" + assert r.path.string() == "/foo" assert r.actions @@ -374,8 +374,8 @@ class TestParseRequest: ir,@1 """ r = language.parse_request({}, l) - assert r.method == "GET" - assert r.path.s.endswith("bar") + assert r.method.string() == "GET" + assert r.path.string().endswith("bar") assert r.actions |