reactivate skipped tests
This commit is contained in:
parent
5914c7c560
commit
4ffdba08c9
@ -89,9 +89,6 @@ class TestCLI:
|
|||||||
# test that additional information on e.g. Serial is printed
|
# test that additional information on e.g. Serial is printed
|
||||||
assert "Serial" in result.stdout
|
assert "Serial" in result.stdout
|
||||||
|
|
||||||
@pytest.mark.skip(
|
|
||||||
reason="disable this test as it is not that easy anymore to predict the outcome of this call"
|
|
||||||
)
|
|
||||||
def test_cli_text(self):
|
def test_cli_text(self):
|
||||||
"""Make sure text returns what we sent it"""
|
"""Make sure text returns what we sent it"""
|
||||||
test_text = "this is some text"
|
test_text = "this is some text"
|
||||||
@ -107,7 +104,9 @@ class TestCLI:
|
|||||||
)
|
)
|
||||||
assert not result.stderr
|
assert not result.stderr
|
||||||
assert DEVFILE_NAME in result.files_updated.keys()
|
assert DEVFILE_NAME in result.files_updated.keys()
|
||||||
assert result.files_updated[DEVFILE_NAME].bytes == test_text + "\n"
|
assert (
|
||||||
|
result.files_updated[DEVFILE_NAME].bytes == "\x1bt\x00" + test_text + "\n"
|
||||||
|
)
|
||||||
|
|
||||||
def test_cli_text_invalid_args(self):
|
def test_cli_text_invalid_args(self):
|
||||||
"""Test a failure to send valid arguments"""
|
"""Test a failure to send valid arguments"""
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
:author: `Michael Billington <michael.billington@gmail.com>`_
|
:author: `Michael Billington <michael.billington@gmail.com>`_
|
||||||
:organization: `python-escpos <https://github.com/python-escpos>`_
|
:organization: `python-escpos <https://github.com/python-escpos>`_
|
||||||
:copyright: Copyright (c) 2016 `Michael Billington <michael.billington@gmail.com>`_
|
:copyright: Copyright (c) 2023 `Michael Billington <michael.billington@gmail.com>`_
|
||||||
:license: MIT
|
:license: MIT
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -86,22 +86,6 @@ def test_invalid_model():
|
|||||||
instance.qr("1234", native=True, model="Hello")
|
instance.qr("1234", native=True, model="Hello")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip("this test has to be debugged")
|
|
||||||
def test_image():
|
|
||||||
"""Test QR as image"""
|
|
||||||
instance = printer.Dummy()
|
|
||||||
instance.qr("1", native=False, size=1)
|
|
||||||
print(instance.output)
|
|
||||||
expected = (
|
|
||||||
b"\x1bt\x00\n"
|
|
||||||
b"\x1dv0\x00\x03\x00\x17\x00\x00\x00\x00\x7f]\xfcA\x19\x04]it]et"
|
|
||||||
b"]ItA=\x04\x7fU\xfc\x00\x0c\x00y~t4\x7f =\xa84j\xd9\xf0\x05\xd4\x90\x00"
|
|
||||||
b"i(\x7f<\xa8A \xd8]'\xc4]y\xf8]E\x80Ar\x94\x7fR@\x00\x00\x00"
|
|
||||||
b"\n\n"
|
|
||||||
)
|
|
||||||
assert instance.output == expected
|
|
||||||
|
|
||||||
|
|
||||||
def test_image_invalid_model():
|
def test_image_invalid_model():
|
||||||
"""Test unsupported QR model as image"""
|
"""Test unsupported QR model as image"""
|
||||||
instance = printer.Dummy()
|
instance = printer.Dummy()
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
:author: `Patrick Kanzler <dev@pkanzler.de>`_
|
:author: `Patrick Kanzler <dev@pkanzler.de>`_
|
||||||
:organization: `python-escpos <https://github.com/python-escpos>`_
|
:organization: `python-escpos <https://github.com/python-escpos>`_
|
||||||
:copyright: Copyright (c) 2016 `python-escpos <https://github.com/python-escpos>`_
|
:copyright: Copyright (c) 2023 `python-escpos <https://github.com/python-escpos>`_
|
||||||
:license: MIT
|
:license: MIT
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -18,6 +18,28 @@ from PIL import Image
|
|||||||
from escpos.printer import Dummy
|
from escpos.printer import Dummy
|
||||||
|
|
||||||
|
|
||||||
|
def test_image():
|
||||||
|
"""Test QR as image"""
|
||||||
|
instance = Dummy()
|
||||||
|
image_arguments = {
|
||||||
|
"high_density_vertical": True,
|
||||||
|
"high_density_horizontal": True,
|
||||||
|
"impl": "bitImageRaster",
|
||||||
|
"fragment_height": 960,
|
||||||
|
"center": False,
|
||||||
|
}
|
||||||
|
instance.qr("1", native=False, image_arguments=image_arguments, size=1)
|
||||||
|
print(instance.output)
|
||||||
|
expected = (
|
||||||
|
b"\x1bt\x00\n"
|
||||||
|
b"\x1dv0\x00\x03\x00\x17\x00\x00\x00\x00\x7f\x1d\xfcAu\x04]\x1dt]et"
|
||||||
|
b"]%tAI\x04\x7fU\xfc\x00 \x00}\xca\xa8h\xdf u\x95\x80x/ \x0b\xf4\x98\x00"
|
||||||
|
b"T\x90\x7fzxA\x00\xd0]zp]o ]u\x80Ao(\x7fd\x90\x00\x00\x00"
|
||||||
|
b"\n\n"
|
||||||
|
)
|
||||||
|
assert instance.output == expected
|
||||||
|
|
||||||
|
|
||||||
@mock.patch("escpos.printer.Dummy.image", spec=Dummy)
|
@mock.patch("escpos.printer.Dummy.image", spec=Dummy)
|
||||||
def test_type_of_object_passed_to_image_function(img_function):
|
def test_type_of_object_passed_to_image_function(img_function):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user