aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_filt.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-09-06 01:37:19 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-09-06 01:37:19 +0200
commiteb2334c6cb7c9ab9c260bc609ae43fb53d441f6f (patch)
treea6b263b856bd035ac154b45fe7e91706918b25f3 /test/test_filt.py
parent853cd810757a02252402da22ae77cab77c5a3fb6 (diff)
parenta8d931089c9ecf450b69321706825cf694c1c08e (diff)
downloadmitmproxy-eb2334c6cb7c9ab9c260bc609ae43fb53d441f6f.tar.gz
mitmproxy-eb2334c6cb7c9ab9c260bc609ae43fb53d441f6f.tar.bz2
mitmproxy-eb2334c6cb7c9ab9c260bc609ae43fb53d441f6f.zip
Merge branch 'master' into readthedocs
Diffstat (limited to 'test/test_filt.py')
-rw-r--r--test/test_filt.py16
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)