aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/data/test.amfbin0 -> 432 bytes
-rw-r--r--test/test_console_contentview.py23
2 files changed, 23 insertions, 0 deletions
diff --git a/test/data/test.amf b/test/data/test.amf
new file mode 100644
index 00000000..c8fc261d
--- /dev/null
+++ b/test/data/test.amf
Binary files differ
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