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>
2020-03-26 18:18:56 -05:00
..
basic Add mechanism for storing warnings and deprecations outside of AnsibleModule (#58993) 2020-01-28 12:12:14 -05:00
common Fix and add tests for some module_utils.common.validation (#67771) 2020-03-26 18:18:56 -05:00
facts Remove with statement for pytest-mock unit tests 2020-01-29 13:29:40 -08:00
json_utils Replace TestCase.assertEquals with TestCase.assertEqual. 2019-11-11 10:24:21 -08:00
parsing
urls
__init__.py
conftest.py
test_distribution_version.py Improve distribution unit tests (#67300) 2020-02-11 16:46:48 -05:00
test_distro.py
test_text.py Wrap CLI Passwords with AnsibleUnsafeText, ensure unsafe context is not lost during encode/decode (#63351) 2019-10-11 09:17:10 -05:00