2017-12-03 22:21:29 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
2023-08-14 23:03:36 +00:00
|
|
|
import pytest
|
|
|
|
|
2017-12-03 22:21:29 +00:00
|
|
|
import escpos.printer as printer
|
|
|
|
from escpos.exceptions import CashDrawerError
|
|
|
|
|
|
|
|
|
|
|
|
def test_raise_CashDrawerError():
|
2021-10-30 16:15:22 +00:00
|
|
|
"""should raise an error if the sequence is invalid."""
|
2017-12-03 22:21:29 +00:00
|
|
|
instance = printer.Dummy()
|
|
|
|
with pytest.raises(CashDrawerError):
|
|
|
|
# call with sequence that is too long
|
2021-10-30 16:15:22 +00:00
|
|
|
instance.cashdraw([1, 1, 1, 1, 1, 1])
|