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
def test_parse_argv_invalid(argv): with pytest.raises(DocoptExit): parse_argv(argv)
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 == ''
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 == ''
def test_parse_argv_replay(argv, expected): args = parse_argv('replay ' + argv) for name in expected: assert args[name] == expected[name]