Skip to content

Commit

Permalink
issue_781: Handling review comments: updated docsting
Browse files Browse the repository at this point in the history
  • Loading branch information
VitthalMagadum committed Aug 26, 2024
1 parent f88211f commit 7db43d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions anta/tests/routing/bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ def _check_peer_capabilities(bgp_output: dict[str, Any], capabilities: list[Mult
----------
bgp_output: The BGP output from the device.
capabilities: List of multiprotocol capabilities to be verified.
strict: Optional check to verifies the only mentioned capabilities should be listed, otherwise test should fail. It defaults to false
The * indicates that all arguments following it must be provided as keyword arguments. To compensate boolean-type-hint-positional-argument (FBT001).
strict: If True, requires exact matching of provided capabilities. Defaults to False.
Returns
-------
Expand Down Expand Up @@ -734,7 +732,7 @@ def test(self) -> None:
class VerifyBGPPeerMPCaps(AntaTest):
"""Verifies the multiprotocol capabilities of a BGP peer in a specified VRF.
Optionally test verifies the only specified multiprotocol capabilities should be listed.
Supports `strict: True` to verify that only the specified capabilities are configured, requiring an exact match.
Expected Results
----------------
Expand Down Expand Up @@ -775,7 +773,7 @@ class BgpPeer(BaseModel):
vrf: str = "default"
"""Optional VRF for BGP peer. If not provided, it defaults to `default`."""
strict: bool = False
"""Optional check to verifies the only mentioned capabilities should be listed, otherwise test should fail. It defaults to false."""
"""If True, requires exact matching of provided capabilities. Defaults to False."""
capabilities: list[MultiProtocolCaps]
"""List of multiprotocol capabilities to be verified."""

Expand Down
4 changes: 2 additions & 2 deletions tests/units/anta_tests/routing/test_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2330,7 +2330,7 @@
"peer_address": "172.30.11.10",
"vrf": "MGMT",
"strict": True,
"capabilities": ["ipv4MplsVpn"],
"capabilities": ["ipv4MplsVpn", "L2vpnEVPN"],
},
]
},
Expand All @@ -2342,7 +2342,7 @@
"'Other than mentioned BGP peer multiprotocol capabilities following capability(s) are listed: ipv4MplsLabels'}}, "
"'172.30.11.10': {'MGMT': {'strict': "
"'Other than mentioned BGP peer multiprotocol capabilities following capability(s) are listed: ipv4Unicast', "
"'ipv4MplsVpn': {'advertised': False, 'received': True, 'enabled': True}}}}}"
"'ipv4MplsVpn': {'advertised': False, 'received': True, 'enabled': True}, 'l2VpnEvpn': 'not found'}}}}"
],
},
},
Expand Down

0 comments on commit 7db43d6

Please sign in to comment.