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", )