From ba47690a030ab9c0008a4eb229413c01d1f5a477 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 16 Jun 2013 00:23:44 +0200 Subject: always read files in binary mode --- test/test_console_contentview.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/test_console_contentview.py') diff --git a/test/test_console_contentview.py b/test/test_console_contentview.py index 1798ce85..f6b45f67 100644 --- a/test/test_console_contentview.py +++ b/test/test_console_contentview.py @@ -114,16 +114,16 @@ class TestContentView: def test_view_image(self): v = cv.ViewImage() p = tutils.test_data.path("data/image.png") - assert v([], file(p).read(), sys.maxint) + assert v([], file(p,"rb").read(), sys.maxint) p = tutils.test_data.path("data/image.gif") - assert v([], file(p).read(), sys.maxint) + assert v([], file(p,"rb").read(), sys.maxint) p = tutils.test_data.path("data/image-err1.jpg") - assert v([], file(p).read(), sys.maxint) + assert v([], file(p,"rb").read(), sys.maxint) p = tutils.test_data.path("data/image.ico") - assert v([], file(p).read(), sys.maxint) + assert v([], file(p,"rb").read(), sys.maxint) assert not v([], "flibble", sys.maxint) @@ -224,22 +224,22 @@ if pyamf: v = cv.ViewAMF() p = tutils.test_data.path("data/amf01") - assert v([], file(p).read(), sys.maxint) + assert v([], file(p,"rb").read(), sys.maxint) p = tutils.test_data.path("data/amf02") - assert v([], file(p).read(), sys.maxint) + assert v([], file(p,"rb").read(), sys.maxint) def test_view_amf_response(): v = cv.ViewAMF() p = tutils.test_data.path("data/amf03") - assert v([], file(p).read(), sys.maxint) + assert v([], file(p,"rb").read(), sys.maxint) 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).read(), sys.maxint) + content_type, output = v([], file(p,"rb").read(), sys.maxint) assert content_type == "Protobuf" assert output[0].text == '1: "3bbc333c-e61c-433b-819a-0b9a8cc103b8"' -- cgit v1.2.3