drop messages
This commit is contained in:
parent
0657106893
commit
453b78c852
1 changed files with 9 additions and 23 deletions
|
@ -91,47 +91,33 @@ test_data: list[TestCase] = [
|
||||||
|
|
||||||
@pytest.mark.parametrize('action, option_type', test_data)
|
@pytest.mark.parametrize('action, option_type', test_data)
|
||||||
def test_has_file_options_detects_file_options(action: Action, option_type: OptionType):
|
def test_has_file_options_detects_file_options(action: Action, option_type: OptionType):
|
||||||
assert (
|
assert has_file_options(action) == option_type.file
|
||||||
has_file_options(action) == option_type.file
|
|
||||||
), f'Action: {action} should be file={option_type.file}'
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('action, option_type', test_data)
|
@pytest.mark.parametrize('action, option_type', test_data)
|
||||||
def test_has_choice_options_detects_choice_options(action: Action, option_type: OptionType):
|
def test_has_choice_options_detects_choice_options(action: Action, option_type: OptionType):
|
||||||
assert (
|
assert has_choice_options(action) == option_type.choice
|
||||||
has_choice_options(action) == option_type.choice
|
|
||||||
), f'Action: {action} should be choice={option_type.choice}'
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('action, option_type', test_data)
|
@pytest.mark.parametrize('action, option_type', test_data)
|
||||||
def test_has_unknown_required_param_options_detects_unknown_required_param_options(
|
def test_has_unknown_required_param_options_detects_unknown_required_param_options(
|
||||||
action: Action, option_type: OptionType
|
action: Action, option_type: OptionType
|
||||||
):
|
):
|
||||||
assert (
|
assert has_unknown_required_param_options(action) == option_type.unknown_required
|
||||||
has_unknown_required_param_options(action) == option_type.unknown_required
|
|
||||||
), f'Action: {action} should be unknown_required={option_type.unknown_required}'
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('action, option_type', test_data)
|
@pytest.mark.parametrize('action, option_type', test_data)
|
||||||
def test_has_exact_options_detects_exact_options(action: Action, option_type: OptionType):
|
def test_has_exact_options_detects_exact_options(action: Action, option_type: OptionType):
|
||||||
assert has_exact_options(action) == (
|
assert has_exact_options(action) == (True in option_type)
|
||||||
True in option_type
|
|
||||||
), f'Action: {action} should have exact options given {option_type}'
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('action, option_type', test_data)
|
@pytest.mark.parametrize('action, option_type', test_data)
|
||||||
def test_produce_exact_options_completion(action: Action, option_type: OptionType):
|
def test_produce_exact_options_completion(action: Action, option_type: OptionType):
|
||||||
try:
|
completion = exact_options_completion(action)
|
||||||
completion = exact_options_completion(action)
|
if True in option_type:
|
||||||
if True in option_type:
|
assert completion.startswith('\ncomplete -c borgmatic')
|
||||||
assert completion.startswith(
|
else:
|
||||||
'\ncomplete -c borgmatic'
|
assert completion == ''
|
||||||
), f'Completion should start with "complete -c borgmatic", got {completion}'
|
|
||||||
else:
|
|
||||||
assert completion == '', f'Completion should be empty, got {completion}'
|
|
||||||
|
|
||||||
except ValueError as value_error:
|
|
||||||
assert False, f'exact_options_completion raised ValueError: {value_error}'
|
|
||||||
|
|
||||||
|
|
||||||
def test_dedent_strip_as_tuple_does_not_raise():
|
def test_dedent_strip_as_tuple_does_not_raise():
|
||||||
|
|
Loading…
Reference in a new issue