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/common/validation
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
..
test_check_mutually_exclusive.py Fix and add tests for some module_utils.common.validation (#67771) 5 years ago
test_check_required_arguments.py Fix and add tests for some module_utils.common.validation (#67771) 5 years ago
test_check_required_together.py Fix and add tests for some module_utils.common.validation (#67771) 5 years ago
test_check_type_bits.py Move type checking methods out of basic.py and add unit tests (#53687) 6 years ago
test_check_type_bool.py Move type checking methods out of basic.py and add unit tests (#53687) 6 years ago
test_check_type_bytes.py Move type checking methods out of basic.py and add unit tests (#53687) 6 years ago
test_check_type_dict.py Move type checking methods out of basic.py and add unit tests (#53687) 6 years ago
test_check_type_float.py Move type checking methods out of basic.py and add unit tests (#53687) 6 years ago
test_check_type_int.py Fix unit tests to work with pytest >= 5.0 (#60246) 5 years ago
test_check_type_jsonarg.py Move type checking methods out of basic.py and add unit tests (#53687) 6 years ago
test_check_type_list.py Move type checking methods out of basic.py and add unit tests (#53687) 6 years ago
test_check_type_path.py Move type checking methods out of basic.py and add unit tests (#53687) 6 years ago
test_check_type_raw.py Move type checking methods out of basic.py and add unit tests (#53687) 6 years ago
test_check_type_str.py Move type checking methods out of basic.py and add unit tests (#53687) 6 years ago
test_count_terms.py Move utility functions out of basic.py (#51715) 6 years ago