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/module_utils
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
..
basic Add mechanism for storing warnings and deprecations outside of AnsibleModule (#58993) 5 years ago
common Fix and add tests for some module_utils.common.validation (#67771) 5 years ago
facts Remove `with` statement for pytest-mock unit tests 5 years ago
json_utils Replace TestCase.assertEquals with TestCase.assertEqual. 5 years ago
parsing Consolidate boolean/mk_boolean conversion functions into a single location 7 years ago
urls ansible-galaxy - define multiple galaxy instances in ansible.cfg (#60553) 5 years ago
__init__.py Add empty-init code-smell script. (#18406) 8 years ago
conftest.py Python 3.8 collections compatibility fixes. 6 years ago
test_distribution_version.py Improve distribution unit tests (#67300) 5 years ago
test_distro.py Update distro unit test (#55003) 6 years ago
test_text.py Wrap CLI Passwords with AnsibleUnsafeText, ensure unsafe context is not lost during encode/decode (#63351) 5 years ago