add missing close() method in metaclass

This commit is contained in:
Alexandre Detiste 2023-12-13 22:08:47 +01:00
parent 254eae07ef
commit aa2e5cd819
2 changed files with 5 additions and 1 deletions

View File

@ -154,6 +154,10 @@ class Escpos(object, metaclass=ABCMeta):
"""Open a printer device/connection."""
pass
def close(self):
"""Close a printer device/connection."""
pass
@abstractmethod
def _raw(self, msg: bytes) -> None:
"""Send raw data to the printer.

View File

@ -173,4 +173,4 @@ def test_read_no_device(cupsprinter) -> None:
THEN check the return value is b''
"""
cupsprinter.device = None
assert cupsprinter._read() == b''
assert cupsprinter._read() == b""