From 3189d144a521fcc98695dd079fb3dd4304de2eee Mon Sep 17 00:00:00 2001 From: Sahn Lam Date: Thu, 16 Aug 2012 23:27:47 -0700 Subject: Optional AMF decoding support If PyAMF is installed, enable AMF decoding. --- test/test_console_contentview.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/test_console_contentview.py') diff --git a/test/test_console_contentview.py b/test/test_console_contentview.py index fbb7e6d2..6f3958df 100644 --- a/test/test_console_contentview.py +++ b/test/test_console_contentview.py @@ -53,6 +53,20 @@ class TestContentView: ) assert f is cv.view_xml + try: + import pyamf + + f = cv.get_view_func( + cv.VIEW_AUTO, + flow.ODictCaseless( + [["content-type", "application/x-amf"]], + ), + "" + ) + assert f is cv.view_amf + except ImportError: + pass + def test_view_urlencoded(self): d = utils.urlencode([("one", "two"), ("three", "four")]) assert cv.view_urlencoded([], d, 100) @@ -111,6 +125,15 @@ class TestContentView: assert not cv.view_image([], "flibble", sys.maxint) + def test_view_amf(self): + try: + import pyamf + + p = tutils.test_data.path("data/test.amf") + assert cv.view_amf([], file(p).read(), sys.maxint) + except ImportError: + pass + def test_view_multipart(self): v = """ --AaB03x -- cgit v1.2.3