Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/base_tests/test_napalm_bgp_neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ def test_contains_peers_at_second_level(transformed_result, host, neighbors):


def test_contains_information_about_neighbor(transformed_result, testdata):
print(testdata)
host_result = transformed_result[testdata["host"]]
host_result.validate()
neighbor_details = host_result.result[testdata["peer"]]
Expand All @@ -228,6 +227,13 @@ def test_contains_information_about_neighbor(transformed_result, testdata):
assert neighbor_details == expected


@pytest.mark.parametrize("host, neighbor_amount", [("R1", 2), ("R2", 1)])
def test_contains_correct_amount_of_hosts(transformed_result, host, neighbor_amount):
host_result = transformed_result[host]
host_result.validate()
assert len(host_result.result) == neighbor_amount


def test_marks_as_failed_if_task_failed(transformed_result):
assert transformed_result["R3"].failed
assert transformed_result["R3"].exception is not None
Expand Down
1 change: 0 additions & 1 deletion tests/base_tests/test_napalm_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def test_contains_interface_names_at_second_level(single_result, testdata):


def test_contains_information_about_interface(single_result, testdata):
print(testdata)
expected = {
"is_enabled": testdata["is_enabled"],
"is_up": testdata["is_up"],
Expand Down
1 change: 0 additions & 1 deletion tests/base_tests/test_napalm_lldp_neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ def test_contains_failed_result_at_second_level_if_task_failed(transformed_resul


def test_contains_information_about_neighbor(interface_result, testdata, selftestdata):
print(testdata)
expected = {
"remote_system_description": REMOTE_SYSTEM_DESCRIPTION,
"remote_system_capab": REMOTE_SYSTEM_CAPAB,
Expand Down
1 change: 0 additions & 1 deletion tests/base_tests/test_netmiko_cdp_neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ def test_contains_neighbors_at_second_level(transformed_result, host, neighbors)


def test_contains_information_about_neighbor(transformed_result, testdata):
print(testdata)
host = testdata["host"]
remote_host = testdata["remote_host"]

Expand Down
8 changes: 7 additions & 1 deletion tests/base_tests/test_netmiko_ospf_neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ def test_contains_neighbors_at_second_level(transformed_result, host, neighbors)
def test_contains_information_about_neighbor(transformed_result, testdata):
host_result = transformed_result[testdata["host"]]
host_result.validate()
print(testdata)
neighbor_details = host_result.result[testdata["neighbor_id"]]
expected = {
"neighbor_id": testdata["neighbor_id"],
Expand All @@ -248,6 +247,13 @@ def test_contains_information_about_neighbor(transformed_result, testdata):
assert neighbor_details == expected


@pytest.mark.parametrize("host, neighbor_amount", [("R1", 3), ("R2", 3)])
def test_contains_correct_amount_of_hosts(transformed_result, host, neighbor_amount):
host_result = transformed_result[host]
host_result.validate()
assert len(host_result.result) == neighbor_amount


def test_marks_as_failed_if_task_failed(transformed_result):
assert transformed_result["R3"].failed
assert transformed_result["R3"].exception is not None
Expand Down