aboutsummaryrefslogtreecommitdiffstats
path: root/test/netlib/http/test_message.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-07-25 15:16:16 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-07-25 15:16:16 -0700
commit79ebcb046e8669f80357a6c3046ec76c6adf49be (patch)
tree441981a16f1be1e620584e4a47f41767ce5585b2 /test/netlib/http/test_message.py
parent3254595584e1d711e7ae292ad34753a52f7a0fc1 (diff)
parent56796aeda25dda66621ce78af227ff46049ef811 (diff)
downloadmitmproxy-79ebcb046e8669f80357a6c3046ec76c6adf49be.tar.gz
mitmproxy-79ebcb046e8669f80357a6c3046ec76c6adf49be.tar.bz2
mitmproxy-79ebcb046e8669f80357a6c3046ec76c6adf49be.zip
Merge remote-tracking branch 'origin/master' into flow_editing_v2
Diffstat (limited to 'test/netlib/http/test_message.py')
-rw-r--r--test/netlib/http/test_message.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/test/netlib/http/test_message.py b/test/netlib/http/test_message.py
index deebd6f2..12e4706c 100644
--- a/test/netlib/http/test_message.py
+++ b/test/netlib/http/test_message.py
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
-import mock
import six
from netlib.tutils import tresp
@@ -71,10 +70,6 @@ class TestMessage(object):
assert resp != 0
- def test_hash(self):
- resp = tresp()
- assert hash(resp)
-
def test_serializable(self):
resp = tresp()
resp2 = http.Response.from_state(resp.get_state())
@@ -117,14 +112,6 @@ class TestMessageContentEncoding(object):
assert r.content == b"message"
assert r.raw_content != b"message"
- r.raw_content = b"foo"
- with mock.patch("netlib.encoding.decode") as e:
- assert r.content
- assert e.call_count == 1
- e.reset_mock()
- assert r.content
- assert e.call_count == 0
-
def test_modify(self):
r = tresp()
assert "content-encoding" not in r.headers
@@ -135,13 +122,6 @@ class TestMessageContentEncoding(object):
r.decode()
assert r.raw_content == b"foo"
- r.encode("identity")
- with mock.patch("netlib.encoding.encode") as e:
- r.content = b"foo"
- assert e.call_count == 0
- r.content = b"bar"
- assert e.call_count == 1
-
with tutils.raises(TypeError):
r.content = u"foo"
@@ -216,15 +196,6 @@ class TestMessageText(object):
r.headers["content-type"] = "text/html; charset=utf8"
assert r.text == u"ü"
- r.encode("identity")
- r.raw_content = b"foo"
- with mock.patch("netlib.encoding.decode") as e:
- assert r.text
- assert e.call_count == 2
- e.reset_mock()
- assert r.text
- assert e.call_count == 0
-
def test_guess_json(self):
r = tresp(content=b'"\xc3\xbc"')
r.headers["content-type"] = "application/json"
@@ -249,14 +220,6 @@ class TestMessageText(object):
assert r.raw_content == b"\xc3\xbc"
assert r.headers["content-length"] == "2"
- r.encode("identity")
- with mock.patch("netlib.encoding.encode") as e:
- e.return_value = b""
- r.text = u"ü"
- assert e.call_count == 0
- r.text = u"ä"
- assert e.call_count == 2
-
def test_unknown_ce(self):
r = tresp()
r.headers["content-type"] = "text/html; charset=wtf"