Skip to content

Commit

Permalink
Issue_853: Updated test failure message
Browse files Browse the repository at this point in the history
  • Loading branch information
geetanjalimanegslab committed Jan 17, 2025
1 parent 68a5acb commit 7886dbd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions anta/tests/snmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,17 @@ def test(self) -> None:
continue

# Verify SNMP views, the read, write and notify settings aligning with version-specific requirements.
if group.read_view and not all([(act_view := group_details.get("readView")) == group.read_view, (configured := group_details.get("readViewConfig"))]):
self.result.is_failure(f"{group}, ReadView: {group.read_view} - View configuration mismatch - ReadView: {act_view}, Configured: {configured}")
if group.read_view and not all(
[(act_view := group_details.get("readView")) == group.read_view, (view_configured := group_details.get("readViewConfig"))]
):
self.result.is_failure(f"{group}, ReadView: {group.read_view} - View configuration mismatch - ReadView: {act_view}, Configured: {view_configured}")

if group.write_view and not all(
[(act_view := group_details.get("writeView")) == group.write_view, (view_configured := group_details.get("writeViewConfig"))]
):
self.result.is_failure(f"{group}, WriteView: {group.write_view} - View configuration mismatch - WriteView: {act_view}, Configured: {configured}")
self.result.is_failure(
f"{group}, WriteView: {group.write_view} - View configuration mismatch - WriteView: {act_view}, Configured: {view_configured}"
)

if group.notify_view and not all(
[(act_view := group_details.get("notifyView")) == group.notify_view, (view_configured := group_details.get("notifyViewConfig"))]
Expand Down

0 comments on commit 7886dbd

Please sign in to comment.