diff options
Diffstat (limited to 'test/test_utils.py')
-rw-r--r-- | test/test_utils.py | 25 |
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" \ |