2016-03-28 13:54:43 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
"""test the facility which enables usage of the with-statement
|
|
|
|
|
2023-08-14 23:03:36 +00:00
|
|
|
:author: `Patrick Kanzler <dev@pkanzler.de>`_
|
2016-03-28 13:54:43 +00:00
|
|
|
:organization: `python-escpos <https://github.com/python-escpos>`_
|
|
|
|
:copyright: Copyright (c) 2016 `python-escpos <https://github.com/python-escpos>`_
|
2017-01-29 23:39:43 +00:00
|
|
|
:license: MIT
|
2016-03-28 13:54:43 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
import escpos.escpos as escpos
|
2023-08-14 23:03:36 +00:00
|
|
|
import escpos.printer as printer
|
2016-06-19 09:51:52 +00:00
|
|
|
|
2016-03-28 13:54:43 +00:00
|
|
|
|
|
|
|
def test_with_statement():
|
2023-08-14 23:03:36 +00:00
|
|
|
"""Use with statement
|
|
|
|
|
|
|
|
.. todo:: Extend these tests as they don't really do anything at the moment"""
|
2016-03-28 13:54:43 +00:00
|
|
|
dummy_printer = printer.Dummy()
|
|
|
|
with escpos.EscposIO(dummy_printer) as p:
|
2021-10-30 16:15:22 +00:00
|
|
|
p.writelines("Some text.\n")
|