2023-07-31 16:55:45 +01:00
|
|
|
import pytest
|
|
|
|
|
|
2023-08-02 21:54:21 +01:00
|
|
|
from primaite.simulator.network.hardware.base import Link, NIC
|
2023-07-31 16:55:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_link_fails_with_same_nic():
|
|
|
|
|
"""Tests Link creation fails with endpoint_a and endpoint_b are the same NIC."""
|
|
|
|
|
with pytest.raises(ValueError):
|
|
|
|
|
nic_a = NIC(
|
|
|
|
|
ip_address="192.168.1.2",
|
2023-08-30 21:38:55 +01:00
|
|
|
subnet_mask="255.255.255.0"
|
2023-07-31 16:55:45 +01:00
|
|
|
)
|
|
|
|
|
Link(endpoint_a=nic_a, endpoint_b=nic_a)
|