Esempio n. 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'
Esempio n. 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)
Esempio n. 3
0
def printer():
    return MP4200TH(pytest.FakeDevice())