1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-08-24 09:03:34 +00:00

Make the Escpos class accept a profile.

This is now used for the block_text function.
This commit is contained in:
Michael Elsdörfer
2016-08-25 17:30:20 +02:00
parent a8574ad9d7
commit 8b5bc9cf8a
2 changed files with 15 additions and 5 deletions

View File

@@ -15,6 +15,7 @@ from __future__ import unicode_literals
from nose.tools import with_setup
import escpos.printer as printer
from escpos.printer import Dummy
import os
import filecmp
@@ -43,3 +44,11 @@ def test_function_text_dies_ist_ein_test_lf():
instance.text('Dies ist ein Test.\n')
instance.flush()
assert(filecmp.cmp('test/Dies ist ein Test.LF.txt', devfile))
def test_block_text():
printer = Dummy()
printer.block_text(
"All the presidents men were eating falafel for breakfast.", font='a')
assert printer.output == \
'All the presidents men were eating falafel\nfor breakfast.'