diff options
| author | Maximilian Hils <git@maximilianhils.com> | 2015-09-27 00:50:14 +0200 | 
|---|---|---|
| committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-27 00:50:14 +0200 | 
| commit | 6075957a9730c6ca5c4c7361bd774345f83d6f59 (patch) | |
| tree | 47ee036f58549a9f757d6e6a5148009cee1b6833 /test/test_flow.py | |
| parent | 1b6ea5caf3ab7c30cc4a822b81ad8288efbae70d (diff) | |
| download | mitmproxy-6075957a9730c6ca5c4c7361bd774345f83d6f59.tar.gz mitmproxy-6075957a9730c6ca5c4c7361bd774345f83d6f59.tar.bz2 mitmproxy-6075957a9730c6ca5c4c7361bd774345f83d6f59.zip | |
move tests to netlib
Diffstat (limited to 'test/test_flow.py')
| -rw-r--r-- | test/test_flow.py | 79 | 
1 files changed, 0 insertions, 79 deletions
| diff --git a/test/test_flow.py b/test/test_flow.py index ca862bda..1d5cc354 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -1105,35 +1105,6 @@ class TestRequest:          r.constrain_encoding()          assert "oink" not in r.headers["accept-encoding"] -    def test_decodeencode(self): -        r = HTTPRequest.wrap(netlib.tutils.treq()) -        r.headers["content-encoding"] = "identity" -        r.content = "falafel" -        r.decode() -        assert "content-encoding" not in r.headers -        assert r.content == "falafel" - -        r = HTTPRequest.wrap(netlib.tutils.treq()) -        r.content = "falafel" -        assert not r.decode() - -        r = HTTPRequest.wrap(netlib.tutils.treq()) -        r.headers["content-encoding"] = "identity" -        r.content = "falafel" -        r.encode("identity") -        assert r.headers["content-encoding"] == "identity" -        assert r.content == "falafel" - -        r = HTTPRequest.wrap(netlib.tutils.treq()) -        r.headers["content-encoding"] = "identity" -        r.content = "falafel" -        r.encode("gzip") -        assert r.headers["content-encoding"] == "gzip" -        assert r.content != "falafel" -        r.decode() -        assert "content-encoding" not in r.headers -        assert r.content == "falafel" -      def test_get_decoded_content(self):          r = HTTPRequest.wrap(netlib.tutils.treq())          r.content = None @@ -1192,35 +1163,6 @@ class TestResponse:          assert not "foo" in r.content          assert r.headers["boo"] == "boo" -    def test_decodeencode(self): -        r = HTTPResponse.wrap(netlib.tutils.tresp()) -        r.headers["content-encoding"] = "identity" -        r.content = "falafel" -        assert r.decode() -        assert "content-encoding" not in r.headers -        assert r.content == "falafel" - -        r = HTTPResponse.wrap(netlib.tutils.tresp()) -        r.headers["content-encoding"] = "identity" -        r.content = "falafel" -        r.encode("identity") -        assert r.headers["content-encoding"] == "identity" -        assert r.content == "falafel" - -        r = HTTPResponse.wrap(netlib.tutils.tresp()) -        r.headers["content-encoding"] = "identity" -        r.content = "falafel" -        r.encode("gzip") -        assert r.headers["content-encoding"] == "gzip" -        assert r.content != "falafel" -        assert r.decode() -        assert "content-encoding" not in r.headers -        assert r.content == "falafel" - -        r.headers["content-encoding"] = "gzip" -        assert not r.decode() -        assert r.content == "falafel" -      def test_get_content_type(self):          resp = HTTPResponse.wrap(netlib.tutils.tresp())          resp.headers = Headers(content_type="text/plain") @@ -1265,27 +1207,6 @@ class TestClientConnection:          assert str(c) -def test_decoded(): -    r = HTTPRequest.wrap(netlib.tutils.treq()) -    assert r.content == "content" -    assert "content-encoding" not in r.headers -    r.encode("gzip") -    assert r.headers["content-encoding"] -    assert r.content != "content" -    with decoded(r): -        assert "content-encoding" not in r.headers -        assert r.content == "content" -    assert r.headers["content-encoding"] -    assert r.content != "content" - -    with decoded(r): -        r.content = "foo" - -    assert r.content != "foo" -    r.decode() -    assert r.content == "foo" - -  def test_replacehooks():      h = flow.ReplaceHooks()      h.add("~q", "foo", "bar") | 
