Skip to content

Commit

Permalink
Updated 'eq' unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ccie18643 committed Sep 4, 2024
1 parent 58bc164 commit 2252ac8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/unit/lib/net_addr/test__ip4_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down

0 comments on commit 2252ac8

Please sign in to comment.