2016-11-15 15:24:44 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
"""tests for line display
|
|
|
|
|
2023-08-14 23:03:36 +00:00
|
|
|
:author: `Patrick Kanzler <dev@pkanzler.de>`_
|
2016-11-15 15:24:44 +00:00
|
|
|
:organization: `python-escpos <https://github.com/python-escpos>`_
|
|
|
|
:copyright: Copyright (c) 2017 `python-escpos <https://github.com/python-escpos>`_
|
|
|
|
:license: MIT
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
import escpos.printer as printer
|
|
|
|
|
|
|
|
|
2023-12-16 21:02:24 +00:00
|
|
|
def test_function_linedisplay_select_on() -> None:
|
2016-11-15 15:24:44 +00:00
|
|
|
"""test the linedisplay_select function (activate)"""
|
|
|
|
instance = printer.Dummy()
|
|
|
|
instance.linedisplay_select(select_display=True)
|
2021-10-30 16:15:22 +00:00
|
|
|
assert instance.output == b"\x1B\x3D\x02"
|
|
|
|
|
2016-11-15 15:24:44 +00:00
|
|
|
|
2023-12-16 21:02:24 +00:00
|
|
|
def test_function_linedisplay_select_off() -> None:
|
2016-11-15 15:24:44 +00:00
|
|
|
"""test the linedisplay_select function (deactivate)"""
|
|
|
|
instance = printer.Dummy()
|
|
|
|
instance.linedisplay_select(select_display=False)
|
2021-10-30 16:15:22 +00:00
|
|
|
assert instance.output == b"\x1B\x3D\x01"
|
|
|
|
|
2016-11-15 15:24:44 +00:00
|
|
|
|
2023-12-16 21:02:24 +00:00
|
|
|
def test_function_linedisplay_clear() -> None:
|
2016-11-15 15:24:44 +00:00
|
|
|
"""test the linedisplay_clear function"""
|
|
|
|
instance = printer.Dummy()
|
|
|
|
instance.linedisplay_clear()
|
2021-10-30 16:15:22 +00:00
|
|
|
assert instance.output == b"\x1B\x40"
|