tests package
Submodules
tests.test_cache_decorator module
- tests.test_cache_decorator.test_cache_performance(cache)[source]
Test that @cache decorator improves performance by using time.sleep.
- tests.test_cache_decorator.test_clear_cache(cache)[source]
Test that clear_cache method empties the cache.
- tests.test_cache_decorator.test_get_cached_value_exact_match(cache)[source]
Test that get_cached_value returns the correct result for an exact match.
- tests.test_cache_decorator.test_get_cached_value_no_match(cache)[source]
Test that get_cached_value returns None when no match is found.
tests.test_log_decorator module
test_func_log_terminal not working
- tests.test_log_decorator.test_func_log_file_json()[source]
Test to check if the json log is working correctly.
- tests.test_log_decorator.test_func_log_terminal(caplog)[source]
Test to check if the terminal log is working correctly using caplog.
- tests.test_log_decorator.test_get_logfile_path_creates_directory()[source]
Test function to validate the creation of log directory and file path by the LoggerManager’s _get_logfile_path method. Also validates the correct date-based naming of the log file when logfile_name is None.
- tests.test_log_decorator.test_log_file_validation()[source]
Test function to check if the terminal logging raise error for using args which don’t impact the code without defining other arguments.
tests.test_retry_decorator module
test_retry_raise_exception_assertion not working
tests.test_run_time_decorator module
Module contents
### Testing:
PowerDecos requires pytest. Tests can then be run after installation inside the package folder with:
PowerDecos requires pytest. Tests can then be run after installation:
run:
`pytest`or run:
`poetry run pytest`to get a html coverage review add
`--cov-report=html`to the end of`pytest`
NOTE: if it doesn’t work try to go inside the folder and then run the commands