From 603b34cadb5e0f4b1e7383db099331b84e75cba0 Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Sun, 7 Aug 2016 13:04:36 +0200 Subject: [PATCH] test add test for the fragment-splitting --- test/test_function_image.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/test_function_image.py b/test/test_function_image.py index f60aa76..b1762f6 100644 --- a/test/test_function_image.py +++ b/test/test_function_image.py @@ -130,3 +130,12 @@ def test_graphics_transparent(): instance = printer.Dummy() instance.image('test/resources/black_transparent.png', impl="graphics") assert(instance.output == b'\x1d(L\x0c\x000p0\x01\x011\x02\x00\x02\x00\xc0\x00\x1d(L\x02\x0002') + + +def test_large_graphics(): + """ + Test whether 'large' graphics that induce a fragmentation are handled correctly. + """ + instance = printer.Dummy() + instance.image('test/resources/black_white.png', impl="bitImageRaster", fragment_height=1) + assert(instance.output == b'\x1dv0\x00\x01\x00\x01\x00\xc0\x1dv0\x00\x01\x00\x01\x00\x00')