Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_nl2():
args = cli.parse(['--no-newline', '--output=x.svg', ''])
assert not args.nl
assert cli.build_config(args)['nl'] is False
def test_svgclass2():
args = cli.parse(['--svgclass=magnolia', '--output=x.svg', ''])
assert args.svgclass == 'magnolia'
assert cli.build_config(args)['svgclass'] == 'magnolia'
def test_version_micro():
args = cli.parse(['-v', 'M1', '0'])
assert args.version == 'M1'
qr = cli.make_code(args)
assert 'M1' == qr.version
def test_border_shortcut():
args = cli.parse(['-b', '10', ''])
assert args.border == 10
def test_segno_version():
try:
cli.parse(['--ver', ''])
except SystemExit as ex:
assert 0 == ex.code
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
def test_version_micro_m1_automatic():
args = cli.parse(['--micro', '12345'])
qr = cli.make_code(args)
assert 'M1' == qr.version
def test_noargs():
try:
cli.parse([])
except SystemExit as ex:
assert 1 == ex.code
def test_scale_shortcut():
args = cli.parse(['-s=1.6', ''])
assert args.scale == 1.6
def test_sequence():
args = cli.parse(['--seq', '-v=1', ''])
assert args.seq
assert '1' == args.version