From 564942c82578aa04920375599f8a295abaed01b0 Mon Sep 17 00:00:00 2001 From: "Geetanjali.mane" Date: Fri, 21 Feb 2025 06:05:46 +0000 Subject: [PATCH] Updated test failure messages --- anta/tests/hardware.py | 4 ++-- tests/units/anta_tests/test_hardware.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/anta/tests/hardware.py b/anta/tests/hardware.py index daae925bc..f4445dce8 100644 --- a/anta/tests/hardware.py +++ b/anta/tests/hardware.py @@ -54,7 +54,7 @@ def test(self) -> None: for interface, value in command_output["xcvrSlots"].items(): if value["mfgName"] not in self.inputs.manufacturers: self.result.is_failure( - f"Interface: {interface} - Transceivers are from unapproved manufacturers - Expected: {', '.join(self.inputs.manufacturers)}" + f"Interface: {interface} - Transceiver is from unapproved manufacturers - Expected: {', '.join(self.inputs.manufacturers)}" f" Actual: {value['mfgName']}" ) @@ -119,7 +119,7 @@ def test(self) -> None: if sensor["hwStatus"] != "ok": self.result.is_failure(f"Sensor: {sensor['name']} - Invalid Hardware State - Expected: ok Actual: {sensor['hwStatus']}") if sensor["alertCount"] != 0: - self.result.is_failure(f"Sensor: {sensor['name']} - Non-zero alert-count - Actual: {sensor['alertCount']}") + self.result.is_failure(f"Sensor: {sensor['name']} - Non-zero alert counter - Actual: {sensor['alertCount']}") class VerifyEnvironmentSystemCooling(AntaTest): diff --git a/tests/units/anta_tests/test_hardware.py b/tests/units/anta_tests/test_hardware.py index 2577e7dde..f47e72bd4 100644 --- a/tests/units/anta_tests/test_hardware.py +++ b/tests/units/anta_tests/test_hardware.py @@ -48,8 +48,8 @@ "expected": { "result": "failure", "messages": [ - "Interface: 1 - Transceivers are from unapproved manufacturers - Expected: Arista Actual: Arista Networks", - "Interface: 2 - Transceivers are from unapproved manufacturers - Expected: Arista Actual: Arista Networks", + "Interface: 1 - Transceiver is from unapproved manufacturers - Expected: Arista Actual: Arista Networks", + "Interface: 2 - Transceiver is from unapproved manufacturers - Expected: Arista Actual: Arista Networks", ], }, }, @@ -178,7 +178,7 @@ "inputs": None, "expected": { "result": "failure", - "messages": ["Sensor: DomTemperatureSensor54 - Non-zero alert-count - Actual: 1"], + "messages": ["Sensor: DomTemperatureSensor54 - Non-zero alert counter - Actual: 1"], }, }, {