You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests Input subclasses should be moved outside of test classes, in other modules to allow reusability across tests and easier imports by external framework leveraging ANTA (AVD).
Solution:
Models are being moved to anta.input_models.<module>. Each test will keep a class variable as a reference of these models to avoid breaking changes. The references will be removed in ANTA v2.0.
Example:
from anta.input_models.connectivity import Host
class Input(AntaTest.Input):
"""Input model for the VerifyReachability test."""
hosts: list[Host]
"""List of host to ping."""
Host: ClassVar[type[Host]] = Host
Tests Input subclasses should be moved outside of test classes, in other modules to allow reusability across tests and easier imports by external framework leveraging ANTA (AVD).
Solution:
Models are being moved to
anta.input_models.<module>
. Each test will keep a class variable as a reference of these models to avoid breaking changes. The references will be removed in ANTA v2.0.Example:
model_config = ConfigDict(extra="forbid")
should be added to these models to fix Extra attributes should be forbidden in nested Input models #809.__str__
should also be added to the models and be leveraged to improve failure messages, to fix Have nicer result failure messages #587.Checklist (in priority):
High priority (AVD tests or high reusability):
The following 3 BGP tests should use the same model to replace <VerifyBGP...>.Input.BgpAfi:
These BGP tests should use the same
BgpPeer
model:The BFD tests should use the same
BFDPeer
model:Low priority (low reusability):
The text was updated successfully, but these errors were encountered: