You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/units
Matt Clay da2cd157f1
Fix arg splitting and key/value parsing (#80030)
* Improve readability of unit test output

This drops the trailing `-expectedXXX` suffixes from test names generated by parametrize.

* Add more splitter unit tests

This fills in code coverage gaps in the exising unit tests.

* Bug fixes and code cleanup

- Fix IndexError exceptions caused by parsing a leading newline, space or escaped space.
- Fix an AttributeError exception in `parse_args` when parsing `None`.
- Fix incorrect parsing of multi-line Jinja2 blocks, which resulted in doubling newlines.
- Remove unreachable exception handlers in the `parse_kv` function.
  The unreachable code was verified through analysis of the code as well as use of the `atheris` fuzzer.
- Remove unnecessary code in the `split_args` function.
- Add an optimization to `split_args` for the empty args case.

* Add unit tests for bug fixes

The splitter code is now fully covered by unit tests.

* Add another issue ref in changelog
3 years ago
..
_vendor Improve unit test code coverage (#80683) 3 years ago
ansible_test Improve code coverage of unit tests (#80904) 3 years ago
cli Resolve issues on python pre-3.10.6 with collection dirs longer than 100 characters (#81061) 3 years ago
compat Clean up unused imports in unit tests (#79893) 3 years ago
config Use ansible.module_utils.common.text.converters (#80704) 3 years ago
errors Clean up unit tests. (#78498) 3 years ago
executor Remove Python 3.5 support (#80972) 3 years ago
galaxy Update galaxy_ng container for tests (#80721) 3 years ago
inventory Fix pointless statements in unit tests (#79940) 3 years ago
inventory_test_data/group_vars Merge branch 'v2_final' into devel_switch_v2 11 years ago
mock Use isinstance in unit tests for type checks (#80906) 3 years ago
module_utils Use isinstance in unit tests for type checks (#80906) 3 years ago
modules Fix pylint disallowed-name errors (#80854) 3 years ago
parsing Fix arg splitting and key/value parsing (#80030) 3 years ago
playbook Fix pylint disallowed-name errors (#80854) 3 years ago
plugins Fix pylint disallowed-name errors (#80854) 3 years ago
regex Add toggle to control invalid character substitution in group names (#52748) 7 years ago
template Clean up unused imports in unit tests (#79893) 3 years ago
utils display, also proxy warnings and deprecations (#81060) 3 years ago
vars Fix pointless statements in unit tests (#79940) 3 years ago
__init__.py Add empty-init code-smell script. (#18406) 9 years ago
requirements.txt Update unit test controller requirements. (#78376) 3 years ago
test_context.py Clean up unit test boilerplate. 6 years ago
test_no_tty.py ansible-test - Fix subprocess management. (#77641) 4 years ago