diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-05 20:45:58 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-05 20:45:58 +0200 |
commit | 5125c669ccd2db5de5f90c66db61e64f63f3ba4c (patch) | |
tree | 6773ffcaada096f7e02c54665b733c1bad350e98 /test/test_filt.py | |
parent | 00561d280ccd4aac06b13b434e0aef4492148cb5 (diff) | |
download | mitmproxy-5125c669ccd2db5de5f90c66db61e64f63f3ba4c.tar.gz mitmproxy-5125c669ccd2db5de5f90c66db61e64f63f3ba4c.tar.bz2 mitmproxy-5125c669ccd2db5de5f90c66db61e64f63f3ba4c.zip |
adjust to new netlib Headers class
Diffstat (limited to 'test/test_filt.py')
-rw-r--r-- | test/test_filt.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/test/test_filt.py b/test/test_filt.py index aeec2485..76e10710 100644 --- a/test/test_filt.py +++ b/test/test_filt.py @@ -1,8 +1,8 @@ import cStringIO -from netlib import odict from libmproxy import filt, flow from libmproxy.protocol import http from libmproxy.models import Error +from netlib.http import Headers import tutils @@ -76,8 +76,7 @@ class TestParsing: class TestMatching: def req(self): - headers = odict.ODictCaseless() - headers["header"] = ["qvalue"] + headers = Headers(header="qvalue") req = http.HTTPRequest( "absolute", "GET", @@ -98,8 +97,7 @@ class TestMatching: def resp(self): f = self.req() - headers = odict.ODictCaseless() - headers["header_response"] = ["svalue"] + headers = Headers([["header_response", "svalue"]]) f.response = http.HTTPResponse( (1, 1), @@ -123,7 +121,7 @@ class TestMatching: def test_asset(self): s = self.resp() assert not self.q("~a", s) - s.response.headers["content-type"] = ["text/javascript"] + s.response.headers["content-type"] = "text/javascript" assert self.q("~a", s) def test_fcontenttype(self): @@ -132,16 +130,16 @@ class TestMatching: assert not self.q("~t content", q) assert not self.q("~t content", s) - q.request.headers["content-type"] = ["text/json"] + q.request.headers["content-type"] = "text/json" assert self.q("~t json", q) assert self.q("~tq json", q) assert not self.q("~ts json", q) - s.response.headers["content-type"] = ["text/json"] + s.response.headers["content-type"] = "text/json" assert self.q("~t json", s) del s.response.headers["content-type"] - s.request.headers["content-type"] = ["text/json"] + s.request.headers["content-type"] = "text/json" assert self.q("~t json", s) assert self.q("~tq json", s) assert not self.q("~ts json", s) |