Skip to content
Merged
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
6 changes: 6 additions & 0 deletions tests/utils/test_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ def test_interface_index_to_ip6_address():
"""Test we can extract from mocked adapters."""
adapters = _generate_mock_adapters()
assert netutils.interface_index_to_ip6_address(adapters, 1) == ('2001:db8::', 1, 1)

# call with invalid adapter
with pytest.raises(RuntimeError):
assert netutils.interface_index_to_ip6_address(adapters, 6)

# call with adapter that has ipv4 address only
with pytest.raises(RuntimeError):
assert netutils.interface_index_to_ip6_address(adapters, 2)


def test_ip6_addresses_to_indexes():
"""Test we can extract from mocked adapters."""
Expand Down