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
Rick Elrod 3c3ffc09c2
Fix and add tests for some module_utils.common.validation (#67771)
* Fix test_check_mutually_exclusive exception-checking

Asserting inside of the `with` context of `pytest.raises`
doesn't actually have any effect. So we move the assert
out, using the exception that gets placed into the scope
after we leave the context, and ensure that it actually gets
checked.

This is also what the pytest documentation says to do:
https://docs.pytest.org/en/latest/assert.html#assertions-about-expected-exceptions

Signed-off-by: Rick Elrod <rick@elrod.me>

* Add some tests for check_required_together

Signed-off-by: Rick Elrod <rick@elrod.me>

* use to_native instead of str, for consistency

Signed-off-by: Rick Elrod <rick@elrod.me>

* Add newlines for pep8

Signed-off-by: Rick Elrod <rick@elrod.me>

* Add tests for check_required_arguments

Signed-off-by: Rick Elrod <rick@elrod.me>

* Sort missing keys in error message, since hashes are unsorted and this can be random

Signed-off-by: Rick Elrod <rick@elrod.me>

* Add changelog entry

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
..
cli galaxy - preserve mode properly on artifact (#68418) 5 years ago
compat Move unit test compat code out of `lib/ansible/`. (#46996) 6 years ago
config Fix inline vaults for plugins in ensure_type (#67492) 5 years ago
errors Remove empty overridden unittest.setUp and unittest.tearDown methods. 5 years ago
executor Try to load action plugin from the same collection as the module (#66701) 5 years ago
galaxy galaxy - preserve mode properly on artifact (#68418) 5 years ago
inventory Clean up unit tests to assist with migration. (#67875) 5 years ago
inventory_test_data/group_vars Merge branch 'v2_final' into devel_switch_v2 10 years ago
mock Replace TestCase.assertEquals with TestCase.assertEqual. 5 years ago
module_utils Fix and add tests for some module_utils.common.validation (#67771) 5 years ago
modules Remove unused unit test files. 5 years ago
parsing Replace TestCase.assertEquals with TestCase.assertEqual. 5 years ago
playbook Split test_play_context_make_become_cmd into files (#68026) 5 years ago
plugins migration final cleanup 5 years ago
regex Add toggle to control invalid character substitution in group names (#52748) 6 years ago
template Do not treat AnsibleUndefined as being unsafe (#65202) 5 years ago
utils Support pre-releases via new SemanticVersion (#68258) 5 years ago
vars Remove empty setUp/tearDown/tearDownClass methods in test classes. 5 years ago
__init__.py Add empty-init code-smell script. (#18406) 8 years ago
requirements.txt Remove unnecessary unit test requirements. 5 years ago
test_constants.py 1st part of ansible config, adds ansible-config to view/manage configs (#12797) 8 years ago
test_context.py Unit tests: remove unused imports (#59740) 5 years ago