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_unit():
args = cli.parse([''])
assert args.unit is None
assert cli.build_config(args)['unit'] is None
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_omit_xmldecl():
args = cli.parse(['--no-xmldecl', '--output=x.svg', ''])
assert not args.xmldecl
assert cli.build_config(args)['xmldecl'] is False
def test_xmldecl():
args = cli.parse(['--output=x.svg', ''])
assert args.xmldecl
assert cli.build_config(args)['xmldecl'] is True
def test_ns2():
args = cli.parse(['--no-namespace', '--output=x.svg', ''])
assert not args.svgns
assert cli.build_config(args)['svgns'] is False
def test_svgversion():
args = cli.parse([''])
assert args.svgversion is None
assert cli.build_config(args)['svgversion'] is None
def test_encoding():
args = cli.parse(['--output=x.svg', ''])
assert args.encoding == 'utf-8'
assert cli.build_config(args)['encoding'] == 'utf-8'
def test_ns():
args = cli.parse(['--output=x.svg', ''])
assert args.svgns is True
assert cli.build_config(args)['svgns'] is True
def test_svgclass():
args = cli.parse(['--output=x.svg', ''])
assert args.svgclass is None
assert 'svgclass' not in cli.build_config(args)
def test_png_svg_command():
args = cli.parse(['--svgversion=1.1', ''])
assert args.svgversion == 1.1
assert 'svgversion' in cli.build_config(args)
assert 'svgversion' not in cli.build_config(args, filename='x.png')