mirror of
https://github.com/python-escpos/python-escpos
synced 2025-12-02 09:43:30 +00:00
* fix unfinished Python2 -> 3 translation * remove some six usage * annotate * fix regression in Six removal * mypy: self.enf is always defined * fix return type of cups.py * Usb idVendor/idProduct are integers * self.default_args is always defined * tweak usb_args, PEP589 is better * lp.py: reassure mypy * correctly cast call to CashDrawerError() * update CUPS test * add missing close() method in metaclass * document a bug in typeshed * query_status() returns bytes as seen in constants.py * remove more SIX usage * test examples too * remove type comment where type is annotated * adapt behavior of cups printer to match other implementations --------- Co-authored-by: Patrick Kanzler <dev@pkanzler.de> Co-authored-by: Patrick Kanzler <4189642+patkan@users.noreply.github.com>
33 lines
981 B
Python
33 lines
981 B
Python
#!/usr/bin/python
|
|
"""tests for line display
|
|
|
|
:author: `Patrick Kanzler <dev@pkanzler.de>`_
|
|
: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
|
|
|
|
|
|
def test_function_linedisplay_select_on() -> None:
|
|
"""test the linedisplay_select function (activate)"""
|
|
instance = printer.Dummy()
|
|
instance.linedisplay_select(select_display=True)
|
|
assert instance.output == b"\x1B\x3D\x02"
|
|
|
|
|
|
def test_function_linedisplay_select_off() -> None:
|
|
"""test the linedisplay_select function (deactivate)"""
|
|
instance = printer.Dummy()
|
|
instance.linedisplay_select(select_display=False)
|
|
assert instance.output == b"\x1B\x3D\x01"
|
|
|
|
|
|
def test_function_linedisplay_clear() -> None:
|
|
"""test the linedisplay_clear function"""
|
|
instance = printer.Dummy()
|
|
instance.linedisplay_clear()
|
|
assert instance.output == b"\x1B\x40"
|