Description
The src/modelinfo/hardware.py module handles normalizing GPU names, running local system stats via nvidia-smi/sysctl, and matching against KNOWN_GPUS. It currently has 0% test coverage.
We need to create tests/test_hardware.py with 100% coverage.
- Test
normalize_gpu_string (stripping spaces, "NVIDIA", etc).
- Test
resolve_gpu for direct matches and multi-GPU strings.
- Test
detect_local_gpu by mocking subprocess.run to prevent real terminal execution during tests.
Use Case
Prevents regressions when modifying hardware detection logic.
Description
The
src/modelinfo/hardware.pymodule handles normalizing GPU names, running local system stats vianvidia-smi/sysctl, and matching againstKNOWN_GPUS. It currently has 0% test coverage.We need to create
tests/test_hardware.pywith 100% coverage.normalize_gpu_string(stripping spaces, "NVIDIA", etc).resolve_gpufor direct matches and multi-GPU strings.detect_local_gpuby mockingsubprocess.runto prevent real terminal execution during tests.Use Case
Prevents regressions when modifying hardware detection logic.