From 66b10b7ed3bedf95cf863546c04d48440d52adce Mon Sep 17 00:00:00 2001 From: bruno-f-cruz <7049351+bruno-f-cruz@users.noreply.github.com> Date: Thu, 18 Jun 2026 02:38:31 -0700 Subject: [PATCH] Lower level for firmware mismatches --- src/contraqctor/qc/harp/harp_device.py | 14 +++++--------- tests/test_qc/harp/test_harp.py | 5 +---- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/contraqctor/qc/harp/harp_device.py b/src/contraqctor/qc/harp/harp_device.py index 3e7a107..85910d4 100644 --- a/src/contraqctor/qc/harp/harp_device.py +++ b/src/contraqctor/qc/harp/harp_device.py @@ -235,18 +235,14 @@ def test_fw_version_matches_reader(self): return self.fail_test( None, f"Firmware version is not a valid semver version. Expected {fw} and got {device_fw}" ) - if fw > device_fw: - return self.fail_test( - False, - f"Expected version {fw} is greater than the device's version {device_fw}. Consider updating the device firmware.", - ) - elif fw == device_fw: - return self.pass_test(True, f"Expected version {fw} matches the device's version {device_fw}") - else: + + if fw != device_fw: return self.warn_test( False, - f"Expected version {fw} is less than the device's version {device_fw}. Consider updating interface package.", + f"Expected version {fw} does not match the device's version {device_fw}. Consider updating the device firmware or interface package.", ) + else: + return self.pass_test(True, f"Expected version {fw} matches the device's version {device_fw}") def test_core_version(self): """Check if the core version of the device matches the one provided""" diff --git a/tests/test_qc/harp/test_harp.py b/tests/test_qc/harp/test_harp.py index e398f3d..8041002 100644 --- a/tests/test_qc/harp/test_harp.py +++ b/tests/test_qc/harp/test_harp.py @@ -357,18 +357,15 @@ def test_fw_version_matches_reader(self, mock_harp_device): mock_harp_device.device_reader.device.firmwareVersion = "1.3.0" result = suite.test_fw_version_matches_reader() - assert result.status == Status.FAILED - assert "Consider updating the device firmware" in result.message + assert result.status == Status.WARNING mock_harp_device.device_reader.device.firmwareVersion = "1.1.0" result = suite.test_fw_version_matches_reader() assert result.status == Status.WARNING - assert "Consider updating interface package" in result.message mock_harp_device.device_reader.device.firmwareVersion = "invalid" result = suite.test_fw_version_matches_reader() assert result.status == Status.FAILED - assert "not a valid semver version" in result.message def test_core_version(self, mock_harp_device): """Test test_core_version method."""