ansible/test/units/module_utils/basic
Felix Fontein ea04e0048d
Allow to deprecate options and aliases by date (#68177)
* Allow to deprecate options and aliases by date instead of only by version.

* Update display.deprecate().

* Adjust behavior to conform to tested behavior, extend tests, and improve C# style.

* Parse date and fail on invalid date.

This is mainly to make sure that people start using invalid dates, and we eventually have a mess to clean up.

* C# code: improve validation and update/extend tests.

* Make sure that deprecate() is not called with both date and version.

* Forgot to remove no longer necessary formatting.

* Adjust order of warnings in C# code.

* Adjust unrelated test.

* Fix grammar (and make that test pass).

* Don't parse date, and adjust message to be same as in #67684.

* Sanity tests: disable date in past test.

* Validate-modules: validate ISO 8601 date format.

* Validate-modules: switch schema declaration for deprecated_aliases to improve error messages for invalid dates.

* Use DateTime instead of string for date deprecation.

* Validate that date in deprecated_aliases is actually a DateTime.

* Fix tests.

* Fix rebasing error.

* Adjust error codes for pylint, and add removed_at_date and deprecated_aliases.date checks to validate-modules.

* Make deprecation date in the past error codes optional.

* Make sure not both version and date are specified for AnsibleModule.deprecate() calls.

* Stop using Python 3.7+ API.

* Make sure errors are actually reported. Re-add 'ansible-' prefix.

* Avoid crashing when 'name' isn't there.

* Linting.

* Update lib/ansible/module_utils/csharp/Ansible.Basic.cs

Co-authored-by: Jordan Borean <jborean93@gmail.com>

* Adjust test to latest change.

* Prefer date over version if both end up in Display.deprecated().

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2020-05-26 20:23:56 -04:00
..
__init__.py AnsibleModules.log() fix for python3 2015-10-12 13:30:27 -07:00
test__log_invocation.py Porting tests to pytest (#33387) 2017-12-05 12:43:13 -08:00
test__symbolic_mode_to_octal.py Split basic units (#33510) 2017-12-18 10:17:13 -08:00
test_argument_spec.py Add mechanism for storing warnings and deprecations outside of AnsibleModule (#58993) 2020-01-28 12:12:14 -05:00
test_atomic_move.py Revert "stricter permissions on atomic_move when creating new file (#68970)" (#68983) 2020-04-16 12:52:15 -04:00
test_deprecate_warn.py Allow to deprecate options and aliases by date (#68177) 2020-05-26 20:23:56 -04:00
test_dict_converters.py Split basic units (#33510) 2017-12-18 10:17:13 -08:00
test_exit_json.py Add some more unittests for fail_json 2020-04-08 07:56:11 -07:00
test_filesystem.py Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
test_get_file_attributes.py AnsibleModule.get_file_attributes: add unit test 2017-12-18 15:49:25 -05:00
test_get_module_path.py Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
test_heuristic_log_sanitize.py Replace TestCase.assertEquals with TestCase.assertEqual. 2019-11-11 10:24:21 -08:00
test_imports.py unit tests: remove unused imports (#59636) 2019-07-26 10:53:31 -04:00
test_log.py Fix unit test parametrize order on Python 3.5. 2018-09-17 22:45:42 -07:00
test_no_log.py Strip no log values from module response keys. Fixes #68400 (#69653) 2020-05-21 16:17:57 -04:00
test_platform_distribution.py unit tests: remove unused imports (#59636) 2019-07-26 10:53:31 -04:00
test_run_command.py Fix filedescriptor out of range in select() when running commands (#65058) 2020-05-14 11:46:34 -04:00
test_safe_eval.py Porting tests to pytest (#33387) 2017-12-05 12:43:13 -08:00
test_selinux.py Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
test_set_mode_if_different.py unit tests: remove unused imports (#60462) 2019-08-13 19:21:43 +02:00
test_tmpdir.py Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00