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

Add methods for simpler newlines (#246)

This commit is contained in:
Romain Porte
2017-08-01 17:09:24 +02:00
committed by Patrick Kanzler
parent 81426ab6dc
commit b64b534394
2 changed files with 46 additions and 0 deletions

View File

@@ -39,3 +39,27 @@ def test_block_text():
"All the presidents men were eating falafel for breakfast.", font='a')
assert printer.output == \
b'All the presidents men were eating falafel\nfor breakfast.'
def test_textln():
printer = get_printer()
printer.textln('hello, world')
assert printer.output == b'hello, world\n'
def test_textln_empty():
printer = get_printer()
printer.textln()
assert printer.output == b'\n'
def test_ln():
printer = get_printer()
printer.ln()
assert printer.output == b'\n'
def test_multiple_ln():
printer = get_printer()
printer.ln(3)
assert printer.output == b'\n\n\n'