diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-06-19 12:00:37 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-06-19 12:00:37 +0200 |
commit | 7bde38dc4a8041e60daeddfea4c581fb90f0e192 (patch) | |
tree | 4d72157970aa6e60e62472e55e1b18c7c079db5c /test | |
parent | 5c0161886ae03dcd3b4cfc726c7a53408cdb5d71 (diff) | |
download | mitmproxy-7bde38dc4a8041e60daeddfea4c581fb90f0e192.tar.gz mitmproxy-7bde38dc4a8041e60daeddfea4c581fb90f0e192.tar.bz2 mitmproxy-7bde38dc4a8041e60daeddfea4c581fb90f0e192.zip |
py3++
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/mastertest.py | 5 | ||||
-rw-r--r-- | test/mitmproxy/test_contentview.py | 16 |
2 files changed, 11 insertions, 10 deletions
diff --git a/test/mitmproxy/mastertest.py b/test/mitmproxy/mastertest.py index 4d04f337..9e726a32 100644 --- a/test/mitmproxy/mastertest.py +++ b/test/mitmproxy/mastertest.py @@ -1,7 +1,8 @@ -import tutils -import netlib.tutils import mock +from . import tutils +import netlib.tutils + from mitmproxy import flow, proxy, models diff --git a/test/mitmproxy/test_contentview.py b/test/mitmproxy/test_contentview.py index 667a36fe..48825bc2 100644 --- a/test/mitmproxy/test_contentview.py +++ b/test/mitmproxy/test_contentview.py @@ -138,16 +138,16 @@ class TestContentView: def test_view_image(self): v = cv.ViewImage() p = tutils.test_data.path("data/image.png") - assert v(file(p, "rb").read()) + assert v(open(p, "rb").read()) p = tutils.test_data.path("data/image.gif") - assert v(file(p, "rb").read()) + assert v(open(p, "rb").read()) p = tutils.test_data.path("data/image-err1.jpg") - assert v(file(p, "rb").read()) + assert v(open(p, "rb").read()) p = tutils.test_data.path("data/image.ico") - assert v(file(p, "rb").read()) + assert v(open(p, "rb").read()) assert not v("flibble") @@ -252,22 +252,22 @@ if pyamf: v = cv.ViewAMF() p = tutils.test_data.path("data/amf01") - assert v(file(p, "rb").read()) + assert v(open(p, "rb").read()) p = tutils.test_data.path("data/amf02") - assert v(file(p, "rb").read()) + assert v(open(p, "rb").read()) def test_view_amf_response(): v = cv.ViewAMF() p = tutils.test_data.path("data/amf03") - assert v(file(p, "rb").read()) + assert v(open(p, "rb").read()) if cv.ViewProtobuf.is_available(): def test_view_protobuf_request(): v = cv.ViewProtobuf() p = tutils.test_data.path("data/protobuf01") - content_type, output = v(file(p, "rb").read()) + content_type, output = v(open(p, "rb").read()) assert content_type == "Protobuf" assert output.next()[0][1] == '1: "3bbc333c-e61c-433b-819a-0b9a8cc103b8"' |