You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The testing module raises exceptions using assert statements in helper functions. While using assert statements in tests is okay, checking and raising explicit exceptions in the library is better.
For example, in this method, I suggest raising a custom exception.
assertinternal_ipinExecutor.execute_command(inventory_path, f'cat {WAZUH_CONF}'), logger.error(f'Error configuring the Manager IP ({internal_ip}) in: {HostInformation.get_os_name_and_version_from_inventory(inventory_path)} agent')
Creating custom testing module exceptions is a better solution to handle known error conditions. The pytest tests will receive these exceptions, making the test fail.
The text was updated successfully, but these errors were encountered:
rauldpm
changed the title
DTT1-Testing Module. Replace the use of assert statements with explicit exceptions in the helper function.
DTT2 - Testing Module. Replace the use of assert statements with explicit exceptions in the helper function.
Apr 26, 2024
The testing module raises exceptions using
assert
statements in helper functions. While using assert statements in tests is okay, checking and raising explicit exceptions in the library is better.For example, in this method, I suggest raising a custom exception.
wazuh-qa/deployability/modules/testing/tests/helpers/agent.py
Lines 92 to 106 in e71e39a
Creating custom testing module exceptions is a better solution to handle known error conditions. The pytest tests will receive these exceptions, making the test fail.
The text was updated successfully, but these errors were encountered: