()
| 14 | |
| 15 | |
| 16 | def test_validate_args() -> None: |
| 17 | program = ArgumentParser() |
| 18 | program.add_argument('--test-1', default = 'test_1', choices = [ 'test_1', 'test_2' ]) |
| 19 | |
| 20 | assert validate_args(program) is True |
| 21 | |
| 22 | subparsers = program.add_subparsers() |
| 23 | sub_program = subparsers.add_parser('sub-command') |
| 24 | sub_program.add_argument('--test-2', default = 'test_2', choices = [ 'test_1', 'test_2' ]) |
| 25 | |
| 26 | assert validate_args(program) is True |
| 27 | |
| 28 | for action in sub_program._actions: |
| 29 | if action.dest == 'test_2': |
| 30 | action.default = 'test_3' |
| 31 | |
| 32 | assert validate_args(program) is False |
| 33 | |
| 34 | |
| 35 | def test_validate_actions() -> None: |
nothing calls this directly
no test coverage detected