Пример #1
0
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
Пример #2
0
def test_error3():
    args = cli.parse(['-e', '-', '123'])
    assert args.error is None
    qr = cli.make_code(args)
    assert not qr.is_micro
    assert 1 == qr.version
    assert 'H' == qr.error
Пример #3
0
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
Пример #4
0
def test_error3():
    args = cli.parse(['-e', '-', '123'])
    assert args.error is None
    qr = cli.make_code(args)
    assert not qr.is_micro
    assert 1 == qr.version
    assert 'H' == qr.error
Пример #5
0
def test_version_micro_m1():
    args = cli.parse(['-v', 'M1', '12345'])
    assert args.version == 'M1'
    qr = cli.make_code(args)
    assert 'M1' == qr.version
Пример #6
0
def test_version2():
    args = cli.parse(['--version', '40', ''])
    assert args.version == '40'
    qr = cli.make_code(args)
    assert 40 == qr.version
Пример #7
0
def test_version():
    args = cli.parse(['-v', '1', ''])
    assert args.version == '1'
    qr = cli.make_code(args)
    assert 1 == qr.version
Пример #8
0
def test_micro_true():
    args = cli.parse(['--micro', ''])
    assert args.micro
    qr = cli.make_code(args)
    assert qr.is_micro
Пример #9
0
def test_pattern2():
    args = cli.parse(['--pattern', '5', ''])
    assert args.pattern == 5
    qr = cli.make_code(args)
    assert qr.mask == 5
Пример #10
0
def test_mode2():
    args = cli.parse(['--mode=byte', ''])
    assert args.mode == 'byte'
    qr = cli.make_code(args)
    assert 'byte' == qr.mode
Пример #11
0
def test_pattern2():
    args = cli.parse(['--pattern', '5', ''])
    assert args.pattern == 5
    qr = cli.make_code(args)
    assert qr.mask == 5
Пример #12
0
def test_pattern():
    args = cli.parse(['-p', '1', ''])
    assert args.pattern == 1
    qr = cli.make_code(args)
    assert qr.mask == 1
Пример #13
0
def test_mode2():
    args = cli.parse(['--mode=byte', ''])
    assert args.mode == 'byte'
    qr = cli.make_code(args)
    assert 'byte' == qr.mode
Пример #14
0
def test_mode():
    args = cli.parse(['-m', 'alphanumeric', 'A'])
    assert args.mode == 'alphanumeric'
    qr = cli.make_code(args)
    assert 'alphanumeric' == qr.mode
Пример #15
0
def test_version_micro_m2_automatic():
    args = cli.parse(['--micro', '123456'])
    qr = cli.make_code(args)
    assert 'M2' == qr.version
Пример #16
0
def test_version_micro_m1():
    args = cli.parse(['-v', 'M1', '12345'])
    assert args.version == 'M1'
    qr = cli.make_code(args)
    assert 'M1' == qr.version
Пример #17
0
def test_version2():
    args = cli.parse(['--version', '40', ''])
    assert args.version == '40'
    qr = cli.make_code(args)
    assert 40 == qr.version
Пример #18
0
def test_version_micro_m2_automatic():
    args = cli.parse(['--micro', '123456'])
    qr = cli.make_code(args)
    assert 'M2' == qr.version
Пример #19
0
def test_mode():
    args = cli.parse(['-m', 'alphanumeric', 'A'])
    assert args.mode == 'alphanumeric'
    qr = cli.make_code(args)
    assert 'alphanumeric' == qr.mode
Пример #20
0
def test_micro_false():
    args = cli.parse(['--no-micro', ''])
    assert not args.micro
    qr = cli.make_code(args)
    assert not qr.is_micro
Пример #21
0
def test_pattern():
    args = cli.parse(['-p', '1', ''])
    assert args.pattern == 1
    qr = cli.make_code(args)
    assert qr.mask == 1
Пример #22
0
def test_micro_true():
    args = cli.parse(['--micro', ''])
    assert args.micro
    qr = cli.make_code(args)
    assert qr.is_micro
Пример #23
0
def test_micro_false():
    args = cli.parse(['--no-micro', ''])
    assert not args.micro
    qr = cli.make_code(args)
    assert not qr.is_micro
Пример #24
0
def test_error():
    args = cli.parse(['-e', 'm', ''])
    assert args.error == 'M'
    qr = cli.make_code(args)
    assert 'H' == qr.error
Пример #25
0
def test_error2():
    args = cli.parse(['-e', 'M', ''])
    assert args.error == 'M'
    qr = cli.make_code(args)
    assert 'H' == qr.error
Пример #26
0
def test_version():
    args = cli.parse(['-v', '1', ''])
    assert args.version == '1'
    qr = cli.make_code(args)
    assert 1 == qr.version
Пример #27
0
def test_error4():
    args = cli.parse(['--error=q', '--no-error-boost', ''])
    assert args.error == 'Q'
    qr = cli.make_code(args)
    assert 'Q' == qr.error
Пример #28
0
def test_error4():
    args = cli.parse(['--error=q', '--no-error-boost', ''])
    assert args.error == 'Q'
    qr = cli.make_code(args)
    assert 'Q' == qr.error