2016-03-10 15:01:35 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
"""tests for panel button function
|
|
|
|
|
2023-08-14 23:03:36 +00:00
|
|
|
:author: `Patrick Kanzler <dev@pkanzler.de>`_
|
2016-03-10 15:01:35 +00:00
|
|
|
:organization: `python-escpos <https://github.com/python-escpos>`_
|
|
|
|
:copyright: Copyright (c) 2016 `python-escpos <https://github.com/python-escpos>`_
|
2017-01-29 23:39:43 +00:00
|
|
|
:license: MIT
|
2016-03-10 15:01:35 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
import escpos.printer as printer
|
|
|
|
|
|
|
|
|
2023-12-16 22:09:20 +00:00
|
|
|
def test_function_panel_button_on() -> None:
|
2016-03-10 15:01:35 +00:00
|
|
|
"""test the panel button function (enabling) by comparing output"""
|
2017-05-21 22:44:22 +00:00
|
|
|
instance = printer.Dummy()
|
2016-03-10 15:01:35 +00:00
|
|
|
instance.panel_buttons()
|
2021-10-30 16:15:22 +00:00
|
|
|
assert instance.output == b"\x1B\x63\x35\x00"
|
2016-03-10 15:01:35 +00:00
|
|
|
|
|
|
|
|
2023-12-16 22:09:20 +00:00
|
|
|
def test_function_panel_button_off() -> None:
|
2016-03-10 15:01:35 +00:00
|
|
|
"""test the panel button function (disabling) by comparing output"""
|
2017-05-21 22:44:22 +00:00
|
|
|
instance = printer.Dummy()
|
2016-03-10 15:01:35 +00:00
|
|
|
instance.panel_buttons(False)
|
2021-10-30 16:15:22 +00:00
|
|
|
assert instance.output == b"\x1B\x63\x35\x01"
|