python-escpos/test/test_function_cashdraw.py
Patrick Kanzler fbabd8ed88
Drop Py37, improve typing and docstrings (#544)
Drops Py3.7, improves typing and adds a mypy config, improves the docstrings and isorts the imports.

* configure isort
* sort with isort
* add github action
* enable flake8-docstrings
* fix docstrings
* add mypy env
* no implicit optional
* add type for raw
* add some type hints
2023-08-15 01:03:36 +02:00

15 lines
373 B
Python

#!/usr/bin/python
import pytest
import escpos.printer as printer
from escpos.exceptions import CashDrawerError
def test_raise_CashDrawerError():
"""should raise an error if the sequence is invalid."""
instance = printer.Dummy()
with pytest.raises(CashDrawerError):
# call with sequence that is too long
instance.cashdraw([1, 1, 1, 1, 1, 1])