ip interface passthrough fixed

This commit is contained in:
Cian Hughes
2023-11-08 12:51:46 +00:00
parent 29f292edaa
commit a524e7c719
2 changed files with 68 additions and 36 deletions

View File

@@ -70,11 +70,9 @@ class TestIPInterface:
@given(st.ip_addresses(v=4))
def test_ipv4_attr_passthrough(self, ip: IPv4Address):
# Should be able to access all attributes of ipaddress.IPv4Address directly,
# not just a copy of the attribute object at instantiation
ip_addr = ip_interface.IPAddress(str(ip))
for attr in self.TEST_ATTRS:
assert getattr(ip_addr, attr) is getattr(ip_addr.obj, attr)
assert getattr(ip_addr, attr) == getattr(ip_addr.obj, attr)
@given(st.ip_addresses(v=4))
def test_ipv4_bool(self, ip: IPv4Address):
@@ -89,11 +87,9 @@ class TestIPInterface:
@given(st.ip_addresses(v=6))
def test_ipv6_attr_passthrough(self, ip: IPv6Address):
# Should be able to access all attributes of ipaddress.IPv4Address directly,
# not just a copy of the attribute object at instantiation
ip_addr = ip_interface.IPAddress(str(ip))
for attr in self.TEST_ATTRS:
assert getattr(ip_addr, attr) is getattr(ip_addr.obj, attr)
assert getattr(ip_addr, attr) == getattr(ip_addr.obj, attr)
@given(st.ip_addresses(v=6))
def test_ipv6_bool(self, ip: IPv6Address):