Merging upstream version 1.2.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-05 11:55:22 +01:00
parent ae7b7df396
commit afeccccd6a
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
154 changed files with 7346 additions and 5000 deletions

View file

@ -0,0 +1,33 @@
# Copyright (c) 2023-2024 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
"""Tests for anta.input_models.interfaces.py."""
# pylint: disable=C0302
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from anta.input_models.interfaces import InterfaceState
if TYPE_CHECKING:
from anta.custom_types import Interface, PortChannelInterface
class TestInterfaceState:
"""Test anta.input_models.interfaces.InterfaceState."""
# pylint: disable=too-few-public-methods
@pytest.mark.parametrize(
("name", "portchannel", "expected"),
[
pytest.param("Ethernet1", "Port-Channel42", "Interface: Ethernet1 Port-Channel: Port-Channel42", id="with port-channel"),
pytest.param("Ethernet1", None, "Interface: Ethernet1", id="no port-channel"),
],
)
def test_valid__str__(self, name: Interface, portchannel: PortChannelInterface | None, expected: str) -> None:
"""Test InterfaceState __str__."""
assert str(InterfaceState(name=name, portchannel=portchannel)) == expected