def test_switch(): ret = parse_args([ "--file-1", MOCK_FILE_PATH, "--" + OPTION_SWITCH, ]) assert vars(ret)[OPTION_SWITCH] is not OPTION_SWITCH_DEFAULT
def test_switch(self): """Test switch parameter.""" ret = parse_args([ "--file-1", MOCK_FILE_PATH, "--" + OPTION_SWITCH, ]) assert vars(ret)[OPTION_SWITCH] is not OPTION_SWITCH_DEFAULT
def test_invalid_option(self): """Test invalid argument.""" with pytest.raises(SystemExit): assert parse_args([OPTION_INVALID])
def test_no_args(self): """Call without args.""" with pytest.raises(SystemExit): parse_args([])
def test_help_option(self): """Test help option.""" with pytest.raises(SystemExit): assert parse_args(["--" + OPTION_HELP])
def test_invalid_option(): with pytest.raises(SystemExit): assert parse_args([OPTION_INVALID])
def test_no_args(): with pytest.raises(SystemExit): parse_args([])
def test_help_option(): with pytest.raises(SystemExit): assert parse_args(["--" + OPTION_HELP])