예제 #1
0
def test_parse_argv_record_defaults():
    actual = parse_argv('record @indian v')
    expected = {
        'record': True,
        'sx_url': '@indian',
        'volumes': ['v'],
        '': False,
        'help': False,
        'version': False,
        'color': False,
        'no_color': False,
        'threads': '8',
        'min_size': '1K',
        'max_size': '1M',
        'entropy_size': None,
        'entropy_seed': None,
        'replay': False,
        'session_file': None,
    }
    assert actual == expected
예제 #2
0
def test_parse_argv_invalid(argv):
    with pytest.raises(DocoptExit):
        parse_argv(argv)
예제 #3
0
def test_parse_argv_help(capsys, arg):
    with pytest.raises(SystemExit):
        parse_argv([arg])
    out, err = capsys.readouterr()
    assert 'Show help' in out
    assert err == ''
예제 #4
0
def test_parse_argv_version(capsys, arg):
    with pytest.raises(SystemExit):
        parse_argv([arg])
    out, err = capsys.readouterr()
    assert 'SXRumble v' in out
    assert err == ''
예제 #5
0
def test_parse_argv_replay(argv, expected):
    args = parse_argv('replay ' + argv)
    for name in expected:
        assert args[name] == expected[name]