示例#1
0
def test_border():
    args = cli.parse(['--quietzone', '0', ''])
    assert args.quiet_zone == 0
示例#2
0
def test_error3():
    args = cli.parse(['123'])
    assert 'H' == args.error
    qr = cli.make_code(args)
    assert 1 == qr.version
    assert 'H' == qr.error
示例#3
0
def test_version():
    args = cli.parse(['-v', '1', ''])
    assert '1' == args.version
    qr = cli.make_code(args)
    assert 1 == qr.version
示例#4
0
def test_omitsize2():
    args = cli.parse(['--no-size', ''])
    assert args.omithw
    assert cli.build_config(args)['omithw'] is True
示例#5
0
def test_noargs():
    with pytest.raises(SystemExit) as e:
        cli.parse([])
        assert 1 == e.exception.code
示例#6
0
def test_svgclass2():
    args = cli.parse(['--svgclass=magnolia', '--output=x.svg', ''])
    assert args.svgclass == 'magnolia'
    assert cli.build_config(args)['svgclass'] == 'magnolia'
示例#7
0
def test_svg_lineclass2():
    args = cli.parse(['--lineclass=magnolia', ''])
    assert args.lineclass == 'magnolia'
    assert cli.build_config(args)['lineclass'] == 'magnolia'
示例#8
0
def test_color_transparent2():
    args = cli.parse(['--color=trans', '-output=x.png', ''])
    assert args.module_color == 'trans'
    assert cli.build_config(args)['module_color'] is None
示例#9
0
def test_background():
    args = cli.parse(['--background', 'red', ''])
    assert args.background == 'red'
示例#10
0
def test_scale_shortcut():
    args = cli.parse(['-s=1.6', ''])
    assert args.scale == 1.6
示例#11
0
def test_color():
    args = cli.parse(['--color', 'green', ''])
    assert args.module_color == 'green'
    assert cli.build_config(args)['module_color'] == 'green'
示例#12
0
def test_scale2():
    args = cli.parse(['--scale=2.0', ''])
    assert args.scale == 2
    assert isinstance(args.scale, int)
示例#13
0
def test_scale():
    args = cli.parse(['--scale=1.6', ''])
    assert args.scale == 1.6
示例#14
0
def test_border_shortcut():
    args = cli.parse(['-qz', '10', ''])
    assert args.quiet_zone == 10
示例#15
0
def test_ns():
    args = cli.parse(['--output=x.svg', ''])
    assert args.svgns is True
    assert cli.build_config(args)['svgns'] is True
示例#16
0
def test_background_transparent2():
    args = cli.parse(['--background=trans', '-output=x.png', ''])
    assert args.background == 'trans'
    assert cli.build_config(args)['background'] is None
示例#17
0
def test_ns2():
    args = cli.parse(['--no-namespace', '--output=x.svg', ''])
    assert not args.svgns
    assert cli.build_config(args)['svgns'] is False
示例#18
0
def test_xmldecl():
    args = cli.parse(['--output=x.svg', ''])
    assert args.xmldecl
    assert cli.build_config(args)['xmldecl'] is True
示例#19
0
def test_svg_lineclass():
    args = cli.parse(['--output=x.svg', ''])
    assert args.lineclass is None
    assert 'lineclass' not in cli.build_config(args)
示例#20
0
def test_omit_xmldecl():
    args = cli.parse(['--no-xmldecl', '--output=x.svg', ''])
    assert not args.xmldecl
    assert cli.build_config(args)['xmldecl'] is False
示例#21
0
def test_omitsize():
    args = cli.parse(['--output=x.svg', ''])
    assert not args.omithw
    assert cli.build_config(args)['omithw'] is False
示例#22
0
def test_not_omit_classes():
    args = cli.parse(['--output=x.svg', ''])
    assert not args.no_classes
    config = cli.build_config(args)
    assert 'svgclass' not in config
    assert 'lineclass' not in config
示例#23
0
def test_segno_version_shortcut():
    with pytest.raises(SystemExit) as e:
        cli.parse(['-V', ''])
        assert 0 == e.exception.code
示例#24
0
def test_omit_classes():
    args = cli.parse(['--no-classes', '--output=x.svg', ''])
    assert args.no_classes
    config = cli.build_config(args)
    assert config['svgclass'] is None
    assert config['lineclass'] is None
示例#25
0
def test_error2():
    args = cli.parse(['-e', 'M', ''])
    assert args.error == 'M'
    qr = cli.make_code(args)
    assert 'M' == qr.error
示例#26
0
def test_title():
    args = cli.parse(['--output=x.svg', ''])
    assert args.title is None
    assert cli.build_config(args)['title'] is None
示例#27
0
def test_error4():
    args = cli.parse(['--error=q', ''])
    assert args.error == 'Q'
    qr = cli.make_code(args)
    assert 'Q' == qr.error
示例#28
0
def test_title2():
    args = cli.parse(['--title=Magnolia', '--output=x.svg', ''])
    assert args.title == 'Magnolia'
    assert cli.build_config(args)['title'] == 'Magnolia'
示例#29
0
def test_version2():
    args = cli.parse(['--version', '40', ''])
    assert args.version == '40'
    qr = cli.make_code(args)
    assert 40 == qr.version
示例#30
0
def test_mode2():
    args = cli.parse(['--mode=byte', ''])
    assert args.mode == 'byte'
    qr = cli.make_code(args)
    assert 'binary' == qr.mode