mirror of
https://github.com/python-escpos/python-escpos
synced 2025-10-23 09:30:00 +00:00
More mypy (#612)
* remove type comment where type is annotated * move function tests * remove six from tests * add none annotations * add more types * change mock (so that mypy understands it)
This commit is contained in:
32
test/test_functions/test_function_linedisplay.py
Normal file
32
test/test_functions/test_function_linedisplay.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user