How to use the segno.make_micro function in segno

To help you get started, we’ve selected a few segno examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heuer / segno / tests / test_issue3.py View on Github external
def test_issue_3_matrix():
    qr = segno.make_micro('test')
    is_ok, msg = matrix_looks_valid(qr.matrix)
    assert is_ok, msg
github heuer / segno / tests / test_make.py View on Github external
def test_create_micro():
    qr = segno.make_micro('1')
    assert qr.is_micro
    assert 'M1' == qr.version
github heuer / segno / tests / test_qrcode.py View on Github external
def test_default_border_mirco():
    qr = segno.make_micro(12, version='m4')
    assert 2 == qr.default_border_size
github heuer / segno / tests / test_png_plte.py View on Github external
def test_plte_micro():
    qr = segno.make_micro('RAIN')
    dark = 'red'
    buff_1 = io.BytesIO()
    buff_2 = io.BytesIO()
    qr.save(buff_1, kind='png', dark=dark, finder_dark=dark, alignment_dark='green')
    qr.save(buff_2, kind='png', dark=dark)
    assert buff_1.getvalue() == buff_2.getvalue()
github heuer / segno / tests / test_make.py View on Github external
def test_micro_invalid_error():
    with pytest.raises(ValueError) as ex:
        segno.make_micro(1, error='h')
    assert 'not available' in str(ex.value)
github heuer / segno / tests / test_issue3.py View on Github external
def test_issue_3():
    qr = segno.make_micro('test')
    assert 'M3' == qr.version
    # This fails since PNG operates with a fixed set of two colors
    qr.save(io.BytesIO(), kind='png')
github heuer / segno / tests / test_issue18.py View on Github external
def test_issue_18_zero_micro():
    qr = segno.make_micro(0)
    assert 'M1' == qr.version
    assert 'numeric' == qr.mode
    assert qr.error is None
github heuer / segno / tests / test_png_plte.py View on Github external
def test_plte_micro2():
    qr = segno.make_micro('RAIN')
    dark = 'red'
    buff_1 = io.BytesIO()
    buff_2 = io.BytesIO()
    qr.save(buff_1, kind='png', dark=dark, finder_dark=dark, dark_module='green')
    qr.save(buff_2, kind='png', dark=dark)
    assert buff_1.getvalue() == buff_2.getvalue()