示例#1
0
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'
示例#2
0
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)
示例#3
0
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))
示例#4
0
def printer():
    return DR700(pytest.FakeDevice())
示例#5
0
def printer():
    return ElginI9(pytest.FakeDevice())
def printer():
    return GenericESCPOS(pytest.FakeDevice())
示例#7
0
def printer():
    return MP4200TH(pytest.FakeDevice())
示例#8
0
def printer():
    return TMT20(pytest.FakeDevice())
示例#9
0
def printer():
    return ElginGeneric(pytest.FakeDevice())
def printer():
    return DarumaGeneric(pytest.FakeDevice())
示例#11
0
def printer():
    return CB55C(pytest.FakeDevice())
示例#12
0
def printer():
    return NitereNPDV1020(pytest.FakeDevice())