Fix test and output

This commit is contained in:
Nick Mowen 2022-12-03 07:32:50 -07:00
parent f1607b301e
commit c0818bcd80
2 changed files with 3 additions and 3 deletions

View File

@ -35,11 +35,11 @@ class TestGpuStats(unittest.TestCase):
@patch("subprocess.run") @patch("subprocess.run")
def test_intel_gpu_stats(self, sp): def test_intel_gpu_stats(self, sp):
process = MagicMock() process = MagicMock()
process.returncode = 0 process.returncode = 124
process.stdout = self.intel_results process.stdout = self.intel_results
sp.return_value = process sp.return_value = process
intel_stats = get_intel_gpu_stats() intel_stats = get_intel_gpu_stats()
assert intel_stats == { assert intel_stats == {
"gpu": "10.73 %", "gpu": "1.34 %",
"mem": "- %", "mem": "- %",
} }

View File

@ -844,7 +844,7 @@ def get_intel_gpu_stats() -> dict[str, str]:
else: else:
video_avg = 1 video_avg = 1
results["gpu"] = round((video_avg + render_avg) / 2, 2) results["gpu"] = f"{round((video_avg + render_avg) / 2, 2)} %"
results["mem"] = "- %" results["mem"] = "- %"
return results return results