Open
Description
Description:
The following functions in cve_bin_tool/fetch_json_db.py
lack proper test coverage and need unit tests to ensure reliability:
Functions Needing Tests:
~~ report
-
get_failed_downloads(self)
- Ensures missing JSON files are correctly identified and logged.
-
verify_signature(self)
- Tests GPG key import failures, invalid/missing signatures, and successful verification.
-
cleanup_directory(self)
- Ensures temporary files and directories are properly removed.
-
handle_download(self)
(Partial)- Handling unsigned mirror data (
not self.is_signed
). - Signature verification failure (
verify_signature
). - Retrying failed downloads and handling max retry conditions.
- Handling unsigned mirror data (
Suggested Actions:
- Mock file system interactions (
Path.exists
,shutil.rmtree
,unlink
). - Mock GPG signature verification (
gnupg.GPG
). - Simulate failed/missing downloads and retry behavior.
Metadata
Metadata
Assignees
Labels
No labels