def test_two_cash_drawer_ports(): # since ESC/Bematech command set supports up to 2 ports printer = MP4200TH(pytest.FakeDevice(), {feature.CASHDRAWER_AVAILABLE_PORTS: 2}) printer.kick_drawer(port=1) # default duration should be 200ms (0xC8) assert printer.device.write_buffer == '\x1B\x80\xC8'
def test_with_more_cash_drawer_ports_than_escbematech_supports(): # although we set available cash ports to three ports, ESC/Bematech # command set only supports two ports printer = MP4200TH(pytest.FakeDevice(), {feature.CASHDRAWER_AVAILABLE_PORTS: 3}) with pytest.raises(CashDrawerException): printer.kick_drawer(port=3)
def test_find_implementations(): impls = find_implementations() assert isinstance(impls, tuple) assert len(impls) >= 1 expected_fqname = 'escpos.impl.epson.GenericESCPOS' for impl in impls: if impl.fqname == expected_fqname: instance = impl.type(pytest.FakeDevice()) assert instance.model.name == impl.model.name assert instance.model.vendor == impl.model.vendor break else: found_fqnames = [i.fqname for i in impls] raise RuntimeError(( 'Cannot find expected FQ name {!r}; found FQ names: {!r}' ).format(expected_fqname, found_fqnames))
def printer(): return DR700(pytest.FakeDevice())
def printer(): return ElginI9(pytest.FakeDevice())
def printer(): return GenericESCPOS(pytest.FakeDevice())
def printer(): return MP4200TH(pytest.FakeDevice())
def printer(): return TMT20(pytest.FakeDevice())
def printer(): return ElginGeneric(pytest.FakeDevice())
def printer(): return DarumaGeneric(pytest.FakeDevice())
def printer(): return CB55C(pytest.FakeDevice())
def printer(): return NitereNPDV1020(pytest.FakeDevice())