netbox-agent/tests/network.py
2020-03-22 18:38:32 +01:00

20 lines
529 B
Python

from netbox_agent.lldp import LLDP
from tests.conftest import parametrize_with_fixtures
@parametrize_with_fixtures(
'lldp/', only_filenames=[
'dedibox1.txt',
])
def test_lldp_parse_with_port_desc(dmi_fixture):
lldp = LLDP(dmi_fixture)
assert lldp.get_switch_port('enp1s0f0') == 'RJ-9'
@parametrize_with_fixtures(
'lldp/', only_filenames=[
'qfx.txt',
])
def test_lldp_parse_without_ifname(dmi_fixture):
lldp = LLDP(dmi_fixture)
assert lldp.get_switch_port('eth0') == 'xe-0/0/1'