Added test for cut without feed, fixed raw code for it
This commit is contained in:
parent
9bc3b30a60
commit
9e47ff2505
|
@ -587,8 +587,12 @@ class Escpos(object):
|
|||
:param feed: print and feed before cutting. default: true
|
||||
:raises ValueError: if mode not in ('FULL', 'PART')
|
||||
"""
|
||||
if feed:
|
||||
self.print_and_feed(6)
|
||||
|
||||
if not feed:
|
||||
self._raw(GS + b'V' + six.int2byte(66) + b'\x00')
|
||||
return
|
||||
|
||||
self.print_and_feed(6)
|
||||
|
||||
mode = mode.upper()
|
||||
if mode not in ('FULL', 'PART'):
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import six
|
||||
|
||||
import escpos.printer as printer
|
||||
from escpos.constants import GS
|
||||
|
||||
|
||||
def test_cut_without_feed():
|
||||
"""Test cut without feeding paper"""
|
||||
instance = printer.Dummy()
|
||||
instance.cut(feed=False)
|
||||
expected = GS + b'V' + six.int2byte(66) + b'\x00'
|
||||
assert(instance.output == expected)
|
Loading…
Reference in New Issue