How to use the segno.cli.parse 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_cli.py View on Github external
def test_nl2():
    args = cli.parse(['--no-newline', '--output=x.svg', ''])
    assert not args.nl
    assert cli.build_config(args)['nl'] is False
github heuer / segno / tests / test_cli.py View on Github external
def test_svgclass2():
    args = cli.parse(['--svgclass=magnolia', '--output=x.svg', ''])
    assert args.svgclass == 'magnolia'
    assert cli.build_config(args)['svgclass'] == 'magnolia'
github heuer / segno / tests / test_cli.py View on Github external
def test_version_micro():
    args = cli.parse(['-v', 'M1', '0'])
    assert args.version == 'M1'
    qr = cli.make_code(args)
    assert 'M1' == qr.version
github heuer / segno / tests / test_cli.py View on Github external
def test_border_shortcut():
    args = cli.parse(['-b', '10', ''])
    assert args.border == 10
github heuer / segno / tests / test_cli.py View on Github external
def test_segno_version():
    try:
        cli.parse(['--ver', ''])
    except SystemExit as ex:
        assert 0 == ex.code
github heuer / segno / tests / test_cli.py View on Github external
def test_error_allow_micro():
    args = cli.parse(['-e', '-', '--micro', '123'])
    assert args.error is None
    qr = cli.make_code(args)
    assert qr.is_micro
    assert 'M1' == qr.version
    assert qr.error is None
github heuer / segno / tests / test_cli.py View on Github external
def test_version_micro_m1_automatic():
    args = cli.parse(['--micro', '12345'])
    qr = cli.make_code(args)
    assert 'M1' == qr.version
github heuer / segno / tests / test_cli.py View on Github external
def test_noargs():
    try:
        cli.parse([])
    except SystemExit as ex:
        assert 1 == ex.code
github heuer / segno / tests / test_cli.py View on Github external
def test_scale_shortcut():
    args = cli.parse(['-s=1.6', ''])
    assert args.scale == 1.6
github heuer / segno / tests / test_cli.py View on Github external
def test_sequence():
    args = cli.parse(['--seq', '-v=1', ''])
    assert args.seq
    assert '1' == args.version