Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unittests #31

Merged
merged 1 commit into from
Dec 12, 2024
Merged

Add unittests #31

merged 1 commit into from
Dec 12, 2024

Conversation

glrs
Copy link
Collaborator

@glrs glrs commented Dec 12, 2024

This pull request includes several updates to the test suite, focusing on improving the robustness and coverage of the tests. The most important changes include adding new test cases, modifying existing test cases for better accuracy, and ensuring proper error handling.

Enhancements to test cases:

  • tests/test_common.py: Modified test_load_realm_class_attribute_error to use a mock module with no attributes allowed, ensuring any attribute access raises AttributeError.
  • tests/test_common.py: Added test_load_realm_class_caching to verify that the load_realm_class function correctly caches the class after the first load, avoiding redundant imports.
  • tests/test_common.py: Added test_get_path_resolve_error to handle exceptions during the Path.resolve call, ensuring the function returns None when an error occurs.

Improvements to error handling:

  • tests/test_report_transfer.py: Added test_transfer_report_general_exception_with_result to simulate an error during logging after a successful subprocess run, ensuring the function handles the exception and logs the appropriate messages.

Minor fixes:

  • tests/test_config_loader.py: Simplified the test_config_immutable by directly attempting to modify the MappingProxyType configuration, ensuring immutability.
  • tests/test_config_loader.py: Updated test_configs_loaded to patch the load_config method directly and ensure the configs attribute is correctly set.
  • tests/test_slurm_utils.py: Added # type: ignore comments to tests with invalid path types to suppress type checking errors.

@glrs glrs merged commit 4b11ffa into NationalGenomicsInfrastructure:main Dec 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant