Exemple #1
0
def test_graphic_circle():
    zdoc = ZPLDocument()
    zdoc.add_graphic_circle(3999)
    assert (zdoc.zpl_bytes == b'^XA\n^GC3999,1,B\n^XZ')

    zdoc = ZPLDocument()
    zdoc.add_graphic_circle(3999, 234)
    assert (zdoc.zpl_bytes == b'^XA\n^GC3999,234,B\n^XZ')

    zdoc = ZPLDocument()
    zdoc.add_graphic_circle(3999, 234, 'W')
    assert (zdoc.zpl_bytes == b'^XA\n^GC3999,234,W\n^XZ')
Exemple #2
0
def test_graphic_circle_errors():
    zdoc = ZPLDocument()
    with pytest.raises(ValueError):
        for val in ('A', 2, 4096, '', None):
            zdoc.add_graphic_circle(val)

    with pytest.raises(ValueError):
        for val in ('A', 0, 4096, '', None):
            zdoc.add_graphic_circle(100, val)

    with pytest.raises(ValueError):
        for val in ('A', 3, '', None):
            zdoc.add_graphic_circle(100, 2, val)