aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_filt.py
diff options
context:
space:
mode:
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)