aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_utils.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-09-05 18:15:47 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-09-05 18:15:47 +0200
commit66ee1f465f6c492d5a4ff5659e6f0346fb243d67 (patch)
tree81599af6bf38402059dcf6f387dfcf9b599c375e /test/test_utils.py
parent3718e59308745e4582f4e8061b4ff6113d9dfc74 (diff)
downloadmitmproxy-66ee1f465f6c492d5a4ff5659e6f0346fb243d67.tar.gz
mitmproxy-66ee1f465f6c492d5a4ff5659e6f0346fb243d67.tar.bz2
mitmproxy-66ee1f465f6c492d5a4ff5659e6f0346fb243d67.zip
headers: adjust everything
Diffstat (limited to 'test/test_utils.py')
-rw-r--r--test/test_utils.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index fc7174d6..374d09ba 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -1,5 +1,5 @@
-from netlib import utils, odict, tutils
-
+from netlib import utils, tutils
+from netlib.http import Headers
def test_bidi():
b = utils.BiDi(a=1, b=2)
@@ -88,20 +88,21 @@ def test_urldecode():
def test_get_header_tokens():
- h = odict.ODictCaseless()
- assert utils.get_header_tokens(h, "foo") == []
- h["foo"] = ["bar"]
- assert utils.get_header_tokens(h, "foo") == ["bar"]
- h["foo"] = ["bar, voing"]
- assert utils.get_header_tokens(h, "foo") == ["bar", "voing"]
- h["foo"] = ["bar, voing", "oink"]
- assert utils.get_header_tokens(h, "foo") == ["bar", "voing", "oink"]
+ headers = Headers()
+ assert utils.get_header_tokens(headers, "foo") == []
+ headers["foo"] = "bar"
+ assert utils.get_header_tokens(headers, "foo") == ["bar"]
+ headers["foo"] = "bar, voing"
+ assert utils.get_header_tokens(headers, "foo") == ["bar", "voing"]
+ headers.set_all("foo", ["bar, voing", "oink"])
+ assert utils.get_header_tokens(headers, "foo") == ["bar", "voing", "oink"]
def test_multipartdecode():
boundary = 'somefancyboundary'
- headers = odict.ODict(
- [('content-type', ('multipart/form-data; boundary=%s' % boundary))])
+ headers = Headers(
+ content_type='multipart/form-data; boundary=%s' % boundary
+ )
content = "--{0}\n" \
"Content-Disposition: form-data; name=\"field1\"\n\n" \
"value1\n" \