Description
Several functions in cve_bin_tool/nvd_api.py lack proper test coverage.
~~ report
Affected Functions
nvd_count_metadata (async, staticmethod)
convert_date_to_nvd_date_api2 (staticmethod)
get_reject_count_api2 (staticmethod)
get_nvd_params (async)
validate_nvd_api (async)
load_nvd_request (async)
get (async)
Steps to Reproduce
Currently, there are no proper tests ensuring the correctness of these functions.
Expected Behavior
- Unit tests should be written for each function.
- Mock API calls where necessary to simulate different scenarios.
Suggested Approach
- Use
pytest and unittest.mock for mocking API responses.
- For async functions, use
pytest-asyncio.
- Ensure coverage for both success and failure cases.
Description
Several functions in
cve_bin_tool/nvd_api.pylack proper test coverage.~~ report
Affected Functions
nvd_count_metadata(async, staticmethod)convert_date_to_nvd_date_api2(staticmethod)get_reject_count_api2(staticmethod)get_nvd_params(async)validate_nvd_api(async)load_nvd_request(async)get(async)Steps to Reproduce
Currently, there are no proper tests ensuring the correctness of these functions.
Expected Behavior
Suggested Approach
pytestandunittest.mockfor mocking API responses.pytest-asyncio.