test(test_fetch_json_db.py): improve test coverage for fetch_json_db #4932
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Fixes #4876
This PR adds unit tests for the
fetch_json_db.py
module, increasing test coverage and ensuring better reliability. The following test cases have been implemented:1.
get_failed_downloads
2.
verify_signature
3.
verify_signature_missing_signature_file
4.
cleanup_directory
5.
handle_download
ignore_signature=False
.Additional Details:
aiohttp.ClientSession
andgnupg.GPG
to simulate real-world conditions.MockResponse
class is implemented to handle HTTP responses in test cases.