validations_libs.tests.test_utils module¶
- class validations_libs.tests.test_utils.TestRunCommandAndLog(methodName='runTest')[source]¶
Bases:
unittest.case.TestCase
- class validations_libs.tests.test_utils.TestUtils(methodName='runTest')[source]¶
Bases:
unittest.case.TestCase
- test_check_community_validations_dir_with_missing_subdir(mock_mkdir, mock_iterdir, mock_exists, mock_isdir, mock_log)[source]¶
- test_check_creation_community_validations_dir(mock_mkdir, mock_iterdir, mock_isdir, mock_exists, mock_log)[source]¶
- test_create_artifacts_dir_runtime_err(mock_mkdirs)[source]¶
Test if failure to create artifacts dir raises ‘RuntimeError’.
- test_create_log_dir_default_perms_runtime_err(mock_exists, mock_access, mock_mkdirs, mock_log)[source]¶
Test if the inaccessible fallback raises ‘RuntimeError’
- test_create_log_dir_existence_issue(mock_exists, mock_access, mock_mkdirs, mock_log)[source]¶
Tests behavior after encountering non-existence of the the selected log folder, failed attempt to create it (raising PermissionError), and finally resorting to a fallback.
- test_create_log_dir_mkdirs(mock_exists, mock_access, mock_mkdirs, mock_log)[source]¶
Test successful creation of the directory if the first access fails.
- test_create_log_dir_runtime_err(mock_exists, mock_access, mock_mkdirs, mock_log)[source]¶
Test if failure of the fallback raises ‘RuntimeError’
- test_create_log_dir_success(mock_exists, mock_access, mock_mkdirs, mock_log)[source]¶
Test successful log dir retrieval on the first try.
- test_get_community_disabled_validations_data(mock_exists, mock_open, mock_data)[source]¶
This test is similar to test_get_community_validations_data in the sense that it doesn’t find the validations_commons one and should look for community validations but the setting is disabled by the config so it shouldn’t find any validations
- test_get_community_validations_data(mock_exists, mock_open, mock_data)[source]¶
The main difference between this test and test_get_validations_data is that this one tries to load first the validations_commons validation then it fails as os.path.exists returns false and then looks for it in the community validations.