From 2252ac80f228ef201ba966c4473a07c7a12a2854 Mon Sep 17 00:00:00 2001 From: Sebastian Majewski Date: Tue, 3 Sep 2024 20:43:03 -0500 Subject: [PATCH] Updated 'eq' unit test. --- tests/unit/lib/net_addr/test__ip4_network.py | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/unit/lib/net_addr/test__ip4_network.py b/tests/unit/lib/net_addr/test__ip4_network.py index e7a888c4..899b3d04 100644 --- a/tests/unit/lib/net_addr/test__ip4_network.py +++ b/tests/unit/lib/net_addr/test__ip4_network.py @@ -249,6 +249,29 @@ def test__net_addr__ip4_network__eq(self) -> None: self._ip4_network == self._ip4_network, ) + if int(self._ip4_network.mask) != 0: + self.assertFalse( + self._ip4_network + == Ip4Network( + ( + Ip4Address( + (int(self._ip4_network.address) - 1) & 0xFF_FF_FF_FF + ), + self._ip4_network.mask, + ), + ), + ) + + self.assertFalse( + self._ip4_network + == Ip4Network( + ( + self._ip4_network.address, + Ip4Mask(f"/{(len(self._ip4_network.mask) + 1) % 33}"), + ), + ), + ) + self.assertFalse( self._ip4_network == "not an IPv4 network", )