salt/tests/unit/utils
Bo Maryniuk 0d9a06b8c6 Cleaner deprecation process with decorators
* Add deprecation decorator scaffold

* Capture type error and unhandled exceptions while function calls

* Aware of the current and future version of deprecation

* Implement initially is_deprecated decorator

* Add an alias for the capitalization

* Fix capitalization easier way

* Remove an extra line

* Add successor name to the deprecation decorator.

* Granulate logging and error messages.

* Implement function swapper

* Raise later the caught exception

* Clarify exception message

* Save function original name

* Remove an extra line

* Hide an alternative hidden function name in the error message, preserving the error itself

* Rename variable as private

* Add a method to detect if a function is using its previous version

* Message to the log and/or raise an exception accordingly to the status of used function

* Log an error along with the exception

* Add internal method documentation

* Add documentation and usage process for decorator "is_deprecated"

* Add documentation and process usage for the decorator "with_deprecated"

* Hide private method name

* Fix PEP8, re-word the error message

* Deprecate basic uptime function

* Add initial decorator unit test

* Rename old/new functions, mock versions

* Move frequent data to the test setup

* Add logging on EOL exception

* Rename and document high to low version test on is_deprecated

* Implement a test on low to high version of is_deprecated decorator

* Add a correction to the test description

* Remove a dead code

* Implement a test for high to low version on is_deprecated, using with_successor param

* Correct typso adn mistaeks

* Implement high to low version with successor param on is_deprecated

* Setup a virtual name for the module

* Implement test for with_deprecated should raise an exception if same deprecated function not found

* Implement test for with_deprecated an old function is picked up if configured

* Correct test description purpose

* Implement test with_deprecated when no deprecation is requested

* Add logging test to the configured deprecation request

* Add logging testing when deprecated version wasn't requested

* Implement test EOL for with_deprecated decorator

* Correct test explanation

* Rename the test

* Implement with_deprecated no EOL, deprecated other function name

* Implement with_deprecated, deprecated other function name, EOL reached

* Add test description for the with_deprecated + with_name + EOL

* Fix confusing test names

* Add logging test to the is_deprecated decorator when function as not found.

* Add more test point to each test, remove empty lines

* Bugfix: at certain conditions a wrong alias name is reported to the log

* Fix a typo in a comment

* Add test for the logging

* Disable a pylint: None will _never_ be raised

* Fix test for the deprecated "status.uptime" version

* Bugfix: Do not yank raised exceptions

* Remove unnecessary decorator

* Add test for the new uptime

* Add test for the new uptime fails when /proc/uptime does not exists

* Rename old test case

* Skip test for the UTC time, unless freeze time is used.

* Fix pylint

* Fix documentation

* Bugfix: proxy-pass the docstring of the decorated function

* Lint fix
2016-04-06 12:55:45 -06:00
..
__init__.py Include the python encoding file header on tests. 2013-11-27 11:19:24 +00:00
aggregation_test.py Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
args.py Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
async_test.py Keep track of SyncWrapper's IOLoop usage 2015-07-29 08:48:33 -07:00
boto_test.py Mock config module in utils test 2016-01-11 16:31:21 -07:00
cache_test.py Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
cloud_test.py Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
config_test.py More pylint fixes 2016-03-15 15:50:05 -06:00
configcomparer_test.py marathon and chronos proxy minions 2015-11-12 10:03:38 -07:00
context_test.py Fix typos of retrieve 2016-04-04 14:27:41 +02:00
decorators_test.py Cleaner deprecation process with decorators 2016-04-06 12:55:45 -06:00
dictupdate_test.py Remove recurse_list from pillar_source_merging_strategy and add pillar_merge_list (bool) instead 2016-01-19 15:06:30 -07:00
event_test.py Sometimes the event system is just too fast 2015-09-04 15:52:06 +01:00
filebuffer_test.py Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
find_test.py Py3 compatibility fixes 2015-01-30 22:25:11 +00:00
format_call_test.py Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
gitfs_test.py Add unit tests to ensure a valid provider 2016-02-08 15:18:11 -06:00
http_test.py Add unit tests for new recursive function 2015-09-29 21:25:47 -06:00
immutabletypes.py Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
kwarg_regex_test.py Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
locales_test.py undo the memoization of contrived locale 2015-06-11 12:13:07 -06:00
network.py Merge remote-tracking branch 'upstream/2015.5' into merge-forward-2015.8 2015-07-20 13:55:14 -06:00
path_join_test.py Py3 compatibility fixes 2015-01-30 22:25:11 +00:00
process_test.py Py3 compatibility fixes 2015-01-30 22:25:05 +00:00
rsax931_test.py no-op 2015-06-15 17:08:43 -06:00
runtime_whitespace_regex_test.py Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
safe_walk_test.py Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
schedule_test.py fixing unit tests related to schedule jobs in pillar. 2015-06-13 08:49:26 -07:00
url_test.py Add http basic auth tests 2015-08-29 21:14:20 -05:00
utils_test.py Adjust test 2016-03-08 20:08:18 +01:00
validate_net_test.py improve test tests/unit/utils/validate_net_test.py useability 2015-02-09 11:52:08 +01:00
verify_test.py Py3 compatibility fixes 2015-01-30 22:25:10 +00:00
vt_test.py Merge remote-tracking branch 'upstream/2015.5' into merge-forward-develop 2015-06-11 13:15:38 -06:00
warnings_test.py Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
which_test.py Fix which test in PR#28812 2015-11-17 11:29:41 +03:00