Problem Description
Running pytest --cov=src reveals that src/modelinfo/parsers/huggingface.py has 0% test coverage. Since the project aims to be zero-dependency (no pytest-responses or requests-mock), we need to mock the standard library urllib.request.urlopen.
Proposed Solution
- Create a
tests/test_huggingface.py file.
- Use
unittest.mock.patch to intercept urllib.request.urlopen and return dummy byte streams (JSON metadata and 8-byte SafeTensors header lengths) so we can test the parsing logic entirely offline.
Alternatives Considered
No response
Additional Context
No response
Problem Description
Running
pytest --cov=srcreveals thatsrc/modelinfo/parsers/huggingface.pyhas 0% test coverage. Since the project aims to be zero-dependency (nopytest-responsesorrequests-mock), we need to mock the standard libraryurllib.request.urlopen.Proposed Solution
tests/test_huggingface.pyfile.unittest.mock.patchto intercepturllib.request.urlopenand return dummy byte streams (JSON metadata and 8-byte SafeTensors header lengths) so we can test the parsing logic entirely offline.Alternatives Considered
No response
Additional Context
No response