-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
As suggested in PR #1 by @sourcery-ai[bot]:
No test exists for PlatformDetector._detect_gpu() when GPU is present.
Task: Add a test case that mocks subprocess.run to simulate GPU presence and verifies correct detection.
Suggested test:
def test_detect_gpu_present(self):
"""Test GPU detection when GPU is present."""
mock_completed_process = MagicMock()
mock_completed_process.stdout = "NVIDIA-SMI 470.57.02 Driver Version: 470.57.02 CUDA Version: 11.4"
with patch('subprocess.run', return_value=mock_completed_process):
result = PlatformDetector._detect_gpu()
assert result is TrueFile: tests/test_worker_service.py
Metadata
Metadata
Assignees
Labels
No labels