diff --git a/tests/unit/lib/net_addr/test__ip4_address.py b/tests/unit/lib/net_addr/test__ip4_address.py index 0c1ea161..1df51146 100644 --- a/tests/unit/lib/net_addr/test__ip4_address.py +++ b/tests/unit/lib/net_addr/test__ip4_address.py @@ -46,6 +46,7 @@ { "_description": "Test the IPv4 address: 0.0.0.0 (str)", "_args": ["0.0.0.0"], + "_kwargs": {}, "_results": { "__str__": "0.0.0.0", "__repr__": "Ip4Address('0.0.0.0')", @@ -71,6 +72,7 @@ { "_description": "Test the IPv4 address: 0.0.0.0 (None)", "_args": [None], + "_kwargs": {}, "_results": { "__str__": "0.0.0.0", "__repr__": "Ip4Address('0.0.0.0')", @@ -96,6 +98,7 @@ { "_description": "Test the IPv4 address: 0.0.0.1 (str)", "_args": ["0.0.0.1"], + "_kwargs": {}, "_results": { "__str__": "0.0.0.1", "__repr__": "Ip4Address('0.0.0.1')", @@ -121,6 +124,7 @@ { "_description": "Test the IPv4 address: 0.255.255.255 (str)", "_args": ["0.255.255.255"], + "_kwargs": {}, "_results": { "__str__": "0.255.255.255", "__repr__": "Ip4Address('0.255.255.255')", @@ -146,6 +150,7 @@ { "_description": "Test the IPv4 address: 1.0.0.0 (str)", "_args": ["1.0.0.0"], + "_kwargs": {}, "_results": { "__str__": "1.0.0.0", "__repr__": "Ip4Address('1.0.0.0')", @@ -171,6 +176,7 @@ { "_description": "Test the IPv4 address: 9.255.255.255 (str)", "_args": ["9.255.255.255"], + "_kwargs": {}, "_results": { "__str__": "9.255.255.255", "__repr__": "Ip4Address('9.255.255.255')", @@ -196,6 +202,7 @@ { "_description": "Test the IPv4 address: 10.0.0.0 (str)", "_args": ["10.0.0.0"], + "_kwargs": {}, "_results": { "__str__": "10.0.0.0", "__repr__": "Ip4Address('10.0.0.0')", @@ -221,6 +228,7 @@ { "_description": "Test the IPv4 address: 10.255.255.255 (str)", "_args": ["10.255.255.255"], + "_kwargs": {}, "_results": { "__str__": "10.255.255.255", "__repr__": "Ip4Address('10.255.255.255')", @@ -246,6 +254,7 @@ { "_description": "Test the IPv4 address: 11.0.0.0 (str)", "_args": ["11.0.0.0"], + "_kwargs": {}, "_results": { "__str__": "11.0.0.0", "__repr__": "Ip4Address('11.0.0.0')", @@ -271,6 +280,7 @@ { "_description": "Test the IPv4 address: 126.255.255.255 (str)", "_args": ["126.255.255.255"], + "_kwargs": {}, "_results": { "__str__": "126.255.255.255", "__repr__": "Ip4Address('126.255.255.255')", @@ -296,6 +306,7 @@ { "_description": "Test the IPv4 address: 127.0.0.0 (str)", "_args": ["127.0.0.0"], + "_kwargs": {}, "_results": { "__str__": "127.0.0.0", "__repr__": "Ip4Address('127.0.0.0')", @@ -321,6 +332,7 @@ { "_description": "Test the IPv4 address: 127.255.255.255 (str)", "_args": ["127.255.255.255"], + "_kwargs": {}, "_results": { "__str__": "127.255.255.255", "__repr__": "Ip4Address('127.255.255.255')", @@ -346,6 +358,7 @@ { "_description": "Test the IPv4 address: 128.0.0.0 (str)", "_args": ["128.0.0.0"], + "_kwargs": {}, "_results": { "__str__": "128.0.0.0", "__repr__": "Ip4Address('128.0.0.0')", @@ -371,6 +384,7 @@ { "_description": "Test the IPv4 address: 169.253.255.255 (str)", "_args": ["169.253.255.255"], + "_kwargs": {}, "_results": { "__str__": "169.253.255.255", "__repr__": "Ip4Address('169.253.255.255')", @@ -396,6 +410,7 @@ { "_description": "Test the IPv4 address: 169.255.0.0 (str)", "_args": ["169.255.0.0"], + "_kwargs": {}, "_results": { "__str__": "169.255.0.0", "__repr__": "Ip4Address('169.255.0.0')", @@ -421,6 +436,7 @@ { "_description": "Test the IPv4 address: 170.0.0.0 (str)", "_args": ["170.0.0.0"], + "_kwargs": {}, "_results": { "__str__": "170.0.0.0", "__repr__": "Ip4Address('170.0.0.0')", @@ -446,6 +462,7 @@ { "_description": "Test the IPv4 address: 172.15.255.255 (str)", "_args": ["172.15.255.255"], + "_kwargs": {}, "_results": { "__str__": "172.15.255.255", "__repr__": "Ip4Address('172.15.255.255')", @@ -471,6 +488,7 @@ { "_description": "Test the IPv4 address: 172.16.0.0 (str)", "_args": ["172.16.0.0"], + "_kwargs": {}, "_results": { "__str__": "172.16.0.0", "__repr__": "Ip4Address('172.16.0.0')", @@ -496,6 +514,7 @@ { "_description": "Test the IPv4 address: 172.31.255.255 (str)", "_args": ["172.31.255.255"], + "_kwargs": {}, "_results": { "__str__": "172.31.255.255", "__repr__": "Ip4Address('172.31.255.255')", @@ -521,6 +540,7 @@ { "_description": "Test the IPv4 address: 172.32.0.0 (str)", "_args": ["172.32.0.0"], + "_kwargs": {}, "_results": { "__str__": "172.32.0.0", "__repr__": "Ip4Address('172.32.0.0')", @@ -546,6 +566,7 @@ { "_description": "Test the IPv4 address: 192.167.255.255 (str)", "_args": ["192.167.255.255"], + "_kwargs": {}, "_results": { "__str__": "192.167.255.255", "__repr__": "Ip4Address('192.167.255.255')", @@ -571,6 +592,7 @@ { "_description": "Test the IPv4 address: 192.168.0.0 (str)", "_args": ["192.168.0.0"], + "_kwargs": {}, "_results": { "__str__": "192.168.0.0", "__repr__": "Ip4Address('192.168.0.0')", @@ -596,6 +618,7 @@ { "_description": "Test the IPv4 address: 192.168.255.255 (str)", "_args": ["192.168.255.255"], + "_kwargs": {}, "_results": { "__str__": "192.168.255.255", "__repr__": "Ip4Address('192.168.255.255')", @@ -621,6 +644,7 @@ { "_description": "Test the IPv4 address: 192.168.255.255 (Ip4Address)", "_args": [Ip4Address("192.168.255.255")], + "_kwargs": {}, "_results": { "__str__": "192.168.255.255", "__repr__": "Ip4Address('192.168.255.255')", @@ -646,6 +670,7 @@ { "_description": "Test the IPv4 address: 192.168.255.255 (int)", "_args": [3232301055], + "_kwargs": {}, "_results": { "__str__": "192.168.255.255", "__repr__": "Ip4Address('192.168.255.255')", @@ -671,6 +696,7 @@ { "_description": "Test the IPv4 address: 192.168.255.255 (bytes)", "_args": [b"\xc0\xa8\xff\xff"], + "_kwargs": {}, "_results": { "__str__": "192.168.255.255", "__repr__": "Ip4Address('192.168.255.255')", @@ -696,6 +722,7 @@ { "_description": "Test the IPv4 address: 192.168.255.255 (bytearray)", "_args": [bytearray(b"\xc0\xa8\xff\xff")], + "_kwargs": {}, "_results": { "__str__": "192.168.255.255", "__repr__": "Ip4Address('192.168.255.255')", @@ -721,6 +748,7 @@ { "_description": "Test the IPv4 address: 192.168.255.255 (memoryview)", "_args": [memoryview(b"\xc0\xa8\xff\xff")], + "_kwargs": {}, "_results": { "__str__": "192.168.255.255", "__repr__": "Ip4Address('192.168.255.255')", @@ -746,6 +774,7 @@ { "_description": "Test the IPv4 address: 192.169.0.0 (str)", "_args": ["192.169.0.0"], + "_kwargs": {}, "_results": { "__str__": "192.169.0.0", "__repr__": "Ip4Address('192.169.0.0')", @@ -771,6 +800,7 @@ { "_description": "Test the IPv4 address: 223.255.255.255 (str)", "_args": ["223.255.255.255"], + "_kwargs": {}, "_results": { "__str__": "223.255.255.255", "__repr__": "Ip4Address('223.255.255.255')", @@ -796,6 +826,7 @@ { "_description": "Test the IPv4 address: 224.0.0.0 (str)", "_args": ["224.0.0.0"], + "_kwargs": {}, "_results": { "__str__": "224.0.0.0", "__repr__": "Ip4Address('224.0.0.0')", @@ -821,6 +852,7 @@ { "_description": "Test the IPv4 address: 239.255.255.255 (str)", "_args": ["239.255.255.255"], + "_kwargs": {}, "_results": { "__str__": "239.255.255.255", "__repr__": "Ip4Address('239.255.255.255')", @@ -846,6 +878,7 @@ { "_description": "Test the IPv4 address: 240.0.0.0 (str)", "_args": ["240.0.0.0"], + "_kwargs": {}, "_results": { "__str__": "240.0.0.0", "__repr__": "Ip4Address('240.0.0.0')", @@ -871,6 +904,7 @@ { "_description": "Test the IPv4 address: 255.255.255.254 (str)", "_args": ["255.255.255.254"], + "_kwargs": {}, "_results": { "__str__": "255.255.255.254", "__repr__": "Ip4Address('255.255.255.254')", @@ -896,6 +930,7 @@ { "_description": "Test the IPv4 address: 255.255.255.255 (str)", "_args": ["255.255.255.255"], + "_kwargs": {}, "_results": { "__str__": "255.255.255.255", "__repr__": "Ip4Address('255.255.255.255')", @@ -927,6 +962,7 @@ class TestNetAddrIp4Address(TestCase): _description: str _args: dict[str, Any] + _kwargs: dict[str, Any] _results: dict[str, Any] def setUp(self) -> None: @@ -934,7 +970,7 @@ def setUp(self) -> None: Initialize the IPv4 address object with testcase arguments. """ - self._ip4_address = Ip4Address(*self._args) + self._ip4_address = Ip4Address(*self._args, **self._kwargs) def test__net_addr__ip4_address__str(self) -> None: """ @@ -1162,6 +1198,7 @@ def test__net_addr__ip4_address__is_limited_broadcast(self) -> None: { "_description": "Test the IPv4 address format: '10.10.10.256'", "_args": ["10.10.10.256"], + "_kwargs": {}, "_results": { "error": Ip4AddressFormatError, "error_message": ( @@ -1172,6 +1209,7 @@ def test__net_addr__ip4_address__is_limited_broadcast(self) -> None: { "_description": "Test the IPv4 address format: '10.10..10'", "_args": ["10.10..10"], + "_kwargs": {}, "_results": { "error": Ip4AddressFormatError, "error_message": ( @@ -1182,6 +1220,7 @@ def test__net_addr__ip4_address__is_limited_broadcast(self) -> None: { "_description": "Test the IPv4 address format: '10.10.10,10'", "_args": ["10.10.10,10"], + "_kwargs": {}, "_results": { "error": Ip4AddressFormatError, "error_message": ( @@ -1192,6 +1231,7 @@ def test__net_addr__ip4_address__is_limited_broadcast(self) -> None: { "_description": "Test the IPv4 address format: b'\xff\xff\xff'", "_args": [b"\xff\xff\xff"], + "_kwargs": {}, "_results": { "error": Ip4AddressFormatError, "error_message": ( @@ -1202,6 +1242,7 @@ def test__net_addr__ip4_address__is_limited_broadcast(self) -> None: { "_description": "Test the IPv4 address format: b'\xff\xff\xff\xff\xff'", "_args": [b"\xff\xff\xff\xff\xff"], + "_kwargs": {}, "_results": { "error": Ip4AddressFormatError, "error_message": ( @@ -1212,6 +1253,7 @@ def test__net_addr__ip4_address__is_limited_broadcast(self) -> None: { "_description": "Test the IPv4 address format: -1", "_args": [-1], + "_kwargs": {}, "_results": { "error": Ip4AddressFormatError, "error_message": ("The IPv4 address format is invalid: -1"), @@ -1220,6 +1262,7 @@ def test__net_addr__ip4_address__is_limited_broadcast(self) -> None: { "_description": "Test the IPv4 address format: 4294967296", "_args": [4294967296], + "_kwargs": {}, "_results": { "error": Ip4AddressFormatError, "error_message": ( @@ -1230,6 +1273,7 @@ def test__net_addr__ip4_address__is_limited_broadcast(self) -> None: { "_description": "Test the IPv4 address format: Ip6Address()", "_args": [Ip6Address()], + "_kwargs": {}, "_results": { "error": Ip4AddressFormatError, "error_message": "The IPv4 address format is invalid: Ip6Address('::')", @@ -1238,6 +1282,7 @@ def test__net_addr__ip4_address__is_limited_broadcast(self) -> None: { "_description": "Test the IPv4 address format: {}", "_args": [{}], + "_kwargs": {}, "_results": { "error": Ip4AddressFormatError, "error_message": "The IPv4 address format is invalid: {}", @@ -1246,6 +1291,7 @@ def test__net_addr__ip4_address__is_limited_broadcast(self) -> None: { "_description": "Test the IPv4 address format: 1.1", "_args": [1.1], + "_kwargs": {}, "_results": { "error": Ip4AddressFormatError, "error_message": "The IPv4 address format is invalid: 1.1", @@ -1260,6 +1306,7 @@ class TestNetAddrIp4AddressErrors(TestCase): _description: str _args: dict[str, Any] + _kwargs: dict[str, Any] _results: dict[str, Any] def test__net_addr__ip4_address__errors(self) -> None: @@ -1268,7 +1315,7 @@ def test__net_addr__ip4_address__errors(self) -> None: """ with self.assertRaises(self._results["error"]) as error: - Ip4Address(*self._args) + Ip4Address(*self._args, **self._kwargs) self.assertEqual( str(error.exception), diff --git a/tests/unit/lib/net_addr/test__ip4_mask.py b/tests/unit/lib/net_addr/test__ip4_mask.py index 272e87b0..4f8f034b 100644 --- a/tests/unit/lib/net_addr/test__ip4_mask.py +++ b/tests/unit/lib/net_addr/test__ip4_mask.py @@ -46,6 +46,7 @@ { "_description": "Test the IPv4 mask: 0.0.0.0 (str)", "_args": ["0.0.0.0"], + "_kwargs": {}, "_results": { "__len__": 0, "__str__": "/0", @@ -61,6 +62,7 @@ { "_description": "Test the IPv4 mask: 0.0.0.0 (None)", "_args": [None], + "_kwargs": {}, "_results": { "__len__": 0, "__str__": "/0", @@ -76,6 +78,7 @@ { "_description": "Test the IPv4 mask: 255.0.0.0 (str)", "_args": ["255.0.0.0"], + "_kwargs": {}, "_results": { "__len__": 8, "__str__": "/8", @@ -91,6 +94,7 @@ { "_description": "Test the IPv4 mask: 255.128.0.0 (str)", "_args": ["255.128.0.0"], + "_kwargs": {}, "_results": { "__len__": 9, "__str__": "/9", @@ -106,6 +110,7 @@ { "_description": "Test the IPv4 mask: 255.128.0.0 (Ip4Mask)", "_args": [Ip4Mask("255.128.0.0")], + "_kwargs": {}, "_results": { "__len__": 9, "__str__": "/9", @@ -121,6 +126,7 @@ { "_description": "Test the IPv4 mask: 255.128.0.0 (bytes)", "_args": [b"\xff\x80\x00\x00"], + "_kwargs": {}, "_results": { "__len__": 9, "__str__": "/9", @@ -136,6 +142,7 @@ { "_description": "Test the IPv4 mask: 255.128.0.0 (bytearray)", "_args": [bytearray(b"\xff\x80\x00\x00")], + "_kwargs": {}, "_results": { "__len__": 9, "__str__": "/9", @@ -151,6 +158,7 @@ { "_description": "Test the IPv4 mask: 255.128.0.0 (memoryview)", "_args": [memoryview(b"\xff\x80\x00\x00")], + "_kwargs": {}, "_results": { "__len__": 9, "__str__": "/9", @@ -166,6 +174,7 @@ { "_description": "Test the IPv4 mask: 255.128.0.0 (int)", "_args": [4286578688], + "_kwargs": {}, "_results": { "__len__": 9, "__str__": "/9", @@ -181,6 +190,7 @@ { "_description": "Test the IPv4 mask: 255.255.0.0 (str)", "_args": ["255.255.0.0"], + "_kwargs": {}, "_results": { "__len__": 16, "__str__": "/16", @@ -196,6 +206,7 @@ { "_description": "Test the IPv4 mask: 255.255.224.0 (str)", "_args": ["255.255.224.0"], + "_kwargs": {}, "_results": { "__len__": 19, "__str__": "/19", @@ -211,6 +222,7 @@ { "_description": "Test the IPv4 mask: 255.255.255.0 (str)", "_args": ["255.255.255.0"], + "_kwargs": {}, "_results": { "__len__": 24, "__str__": "/24", @@ -226,6 +238,7 @@ { "_description": "Test the IPv4 mask: 255.255.255.252 (str)", "_args": ["255.255.255.252"], + "_kwargs": {}, "_results": { "__len__": 30, "__str__": "/30", @@ -241,6 +254,7 @@ { "_description": "Test the IPv4 mask: 255.255.255.255 (str)", "_args": ["255.255.255.255"], + "_kwargs": {}, "_results": { "__len__": 32, "__str__": "/32", @@ -262,6 +276,7 @@ class TestNetAddrIp4Mask(TestCase): _description: str _args: dict[str, Any] + _kwargs: dict[str, Any] _results: dict[str, Any] def setUp(self) -> None: @@ -269,7 +284,7 @@ def setUp(self) -> None: Initialize the IPv4 mask object with testcase arguments. """ - self._ip4_mask = Ip4Mask(*self._args) + self._ip4_mask = Ip4Mask(*self._args, **self._kwargs) def test__net_addr__ip4_mask__len(self) -> None: """ @@ -386,6 +401,7 @@ def test__net_addr__ip4_mask__is_ip6(self) -> None: { "_description": "Test the IPv4 mask format: '255.255.255.256'", "_args": ["255.255.255.256"], + "_kwargs": {}, "_results": { "error": Ip4MaskFormatError, "error_message": ( @@ -396,6 +412,7 @@ def test__net_addr__ip4_mask__is_ip6(self) -> None: { "_description": "Test the IPv4 mask format: '255.255.255,255'", "_args": ["255.255.255,255"], + "_kwargs": {}, "_results": { "error": Ip4MaskFormatError, "error_message": ( @@ -406,6 +423,7 @@ def test__net_addr__ip4_mask__is_ip6(self) -> None: { "_description": "Test the IPv4 mask format: '255.254.255.255'", "_args": ["255.254.255.255"], + "_kwargs": {}, "_results": { "error": Ip4MaskFormatError, "error_message": ( @@ -416,6 +434,7 @@ def test__net_addr__ip4_mask__is_ip6(self) -> None: { "_description": "Test the IPv4 mask format: b'\xff\xff\xff'", "_args": [b"\xff\xff\xff"], + "_kwargs": {}, "_results": { "error": Ip4MaskFormatError, "error_message": ( @@ -426,6 +445,7 @@ def test__net_addr__ip4_mask__is_ip6(self) -> None: { "_description": "Test the IPv4 mask format: b'\xff\xff\xff\xff\xff'", "_args": [b"\xff\xff\xff\xff\xff"], + "_kwargs": {}, "_results": { "error": Ip4MaskFormatError, "error_message": ( @@ -436,6 +456,7 @@ def test__net_addr__ip4_mask__is_ip6(self) -> None: { "_description": "Test the IPv4 mask format: -1", "_args": [-1], + "_kwargs": {}, "_results": { "error": Ip4MaskFormatError, "error_message": ("The IPv4 mask format is invalid: -1"), @@ -444,6 +465,7 @@ def test__net_addr__ip4_mask__is_ip6(self) -> None: { "_description": "Test the IPv4 mask format: 4294967296", "_args": [4294967296], + "_kwargs": {}, "_results": { "error": Ip4MaskFormatError, "error_message": ( @@ -454,6 +476,7 @@ def test__net_addr__ip4_mask__is_ip6(self) -> None: { "_description": "Test the IPv4 mask format: Ip6Mask()", "_args": [Ip6Mask()], + "_kwargs": {}, "_results": { "error": Ip4MaskFormatError, "error_message": ( @@ -464,6 +487,7 @@ def test__net_addr__ip4_mask__is_ip6(self) -> None: { "_description": "Test the IPv4 mask format: {}", "_args": [{}], + "_kwargs": {}, "_results": { "error": Ip4MaskFormatError, "error_message": "The IPv4 mask format is invalid: {}", @@ -472,6 +496,7 @@ def test__net_addr__ip4_mask__is_ip6(self) -> None: { "_description": "Test the IPv4 address format: 1.1", "_args": [1.1], + "_kwargs": {}, "_results": { "error": Ip4MaskFormatError, "error_message": "The IPv4 mask format is invalid: 1.1", @@ -486,6 +511,7 @@ class TestNetAddrIp4MaskErrors(TestCase): _description: str _args: dict[str, Any] + _kwargs: dict[str, Any] _results: dict[str, Any] def test__net_addr__ip4_mask__errors(self) -> None: @@ -494,7 +520,7 @@ def test__net_addr__ip4_mask__errors(self) -> None: """ with self.assertRaises(self._results["error"]) as error: - Ip4Mask(*self._args) + Ip4Mask(*self._args, **self._kwargs) self.assertEqual( str(error.exception), diff --git a/tests/unit/lib/net_addr/test__ip6_address.py b/tests/unit/lib/net_addr/test__ip6_address.py index 9ebebb7d..cc1077d3 100644 --- a/tests/unit/lib/net_addr/test__ip6_address.py +++ b/tests/unit/lib/net_addr/test__ip6_address.py @@ -46,6 +46,7 @@ { "_description": "Test the IPv6 address: :: (str)", "_args": ["::"], + "_kwargs": {}, "_results": { "__str__": "::", "__repr__": "Ip6Address('::')", @@ -71,6 +72,7 @@ { "_description": "Test the IPv6 address: :: (None)", "_args": [None], + "_kwargs": {}, "_results": { "__str__": "::", "__repr__": "Ip6Address('::')", @@ -96,6 +98,7 @@ { "_description": "Test the IPv6 address: ::1 (str)", "_args": ["::1"], + "_kwargs": {}, "_results": { "__str__": "::1", "__repr__": "Ip6Address('::1')", @@ -121,6 +124,7 @@ { "_description": "Test the IPv6 address: 2000:: (str)", "_args": ["2000::"], + "_kwargs": {}, "_results": { "__str__": "2000::", "__repr__": "Ip6Address('2000::')", @@ -146,6 +150,7 @@ { "_description": "Test the IPv6 address: 3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff (str)", "_args": ["3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"], + "_kwargs": {}, "_results": { "__str__": "3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "__repr__": "Ip6Address('3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff')", @@ -173,6 +178,7 @@ { "_description": "Test the IPv6 address: fe80:: (str)", "_args": ["fe80::"], + "_kwargs": {}, "_results": { "__str__": "fe80::", "__repr__": "Ip6Address('fe80::')", @@ -198,6 +204,7 @@ { "_description": "Test the IPv6 address: febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff (str)", "_args": ["febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff"], + "_kwargs": {}, "_results": { "__str__": "febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "__repr__": "Ip6Address('febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff')", @@ -225,6 +232,7 @@ { "_description": "Test the IPv6 address: fc00:: (str)", "_args": ["fc00::"], + "_kwargs": {}, "_results": { "__str__": "fc00::", "__repr__": "Ip6Address('fc00::')", @@ -250,6 +258,7 @@ { "_description": "Test the IPv6 address: fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff (str)", "_args": ["fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"], + "_kwargs": {}, "_results": { "__str__": "fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "__repr__": "Ip6Address('fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff')", @@ -277,6 +286,7 @@ { "_description": "Test the IPv6 address: ff00:: (str)", "_args": ["ff00::"], + "_kwargs": {}, "_results": { "__str__": "ff00::", "__repr__": "Ip6Address('ff00::')", @@ -302,6 +312,7 @@ { "_description": "Test the IPv6 address: ff02::1 (str)", "_args": ["ff02::1"], + "_kwargs": {}, "_results": { "__str__": "ff02::1", "__repr__": "Ip6Address('ff02::1')", @@ -327,6 +338,7 @@ { "_description": "Test the IPv6 address: ff02::2 (str)", "_args": ["ff02::2"], + "_kwargs": {}, "_results": { "__str__": "ff02::2", "__repr__": "Ip6Address('ff02::2')", @@ -352,6 +364,7 @@ { "_description": "Test the IPv6 address: ff02::1:ff00:0 (str)", "_args": ["ff02::1:ff00:0"], + "_kwargs": {}, "_results": { "__str__": "ff02::1:ff00:0", "__repr__": "Ip6Address('ff02::1:ff00:0')", @@ -377,6 +390,7 @@ { "_description": "Test the IPv6 address: ff02::1:ff00:0 (str uppercase)", "_args": ["FF02::1:FF00:0"], + "_kwargs": {}, "_results": { "__str__": "ff02::1:ff00:0", "__repr__": "Ip6Address('ff02::1:ff00:0')", @@ -402,6 +416,7 @@ { "_description": "Test the IPv6 address: ff02::1:ff00:0 (Ip6Address)", "_args": [Ip6Address("ff02::1:ff00:0")], + "_kwargs": {}, "_results": { "__str__": "ff02::1:ff00:0", "__repr__": "Ip6Address('ff02::1:ff00:0')", @@ -427,6 +442,7 @@ { "_description": "Test the IPv6 address: ff02::1:ff00:0 (int)", "_args": [338963523518870617245727861372719464448], + "_kwargs": {}, "_results": { "__str__": "ff02::1:ff00:0", "__repr__": "Ip6Address('ff02::1:ff00:0')", @@ -454,6 +470,7 @@ "_args": [ b"\xff\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\x00\x00\x00" ], + "_kwargs": {}, "_results": { "__str__": "ff02::1:ff00:0", "__repr__": "Ip6Address('ff02::1:ff00:0')", @@ -483,6 +500,7 @@ b"\xff\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\x00\x00\x00" ) ], + "_kwargs": {}, "_results": { "__str__": "ff02::1:ff00:0", "__repr__": "Ip6Address('ff02::1:ff00:0')", @@ -512,6 +530,7 @@ b"\xff\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\x00\x00\x00" ) ], + "_kwargs": {}, "_results": { "__str__": "ff02::1:ff00:0", "__repr__": "Ip6Address('ff02::1:ff00:0')", @@ -537,6 +556,7 @@ { "_description": "Test the IPv6 address: ff02::1:ffff:ffff (str)", "_args": ["ff02::1:ffff:ffff"], + "_kwargs": {}, "_results": { "__str__": "ff02::1:ffff:ffff", "__repr__": "Ip6Address('ff02::1:ffff:ffff')", @@ -562,6 +582,7 @@ { "_description": "Test the IPv6 address: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff (str)", "_args": ["ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"], + "_kwargs": {}, "_results": { "__str__": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "__repr__": "Ip6Address('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff')", @@ -595,6 +616,7 @@ class TestNetAddrIp6Address(TestCase): _description: str _args: dict[str, Any] + _kwargs: dict[str, Any] _results: dict[str, Any] def setUp(self) -> None: @@ -602,7 +624,7 @@ def setUp(self) -> None: Initialize the IPv6 address object with testcase arguments. """ - self._ip6_address = Ip6Address(*self._args) + self._ip6_address = Ip6Address(*self._args, **self._kwargs) def test__net_addr__ip6_address__str(self) -> None: """ @@ -819,6 +841,7 @@ def test__net_addr__ip6_address__is_private(self) -> None: { "_description": "Test the IPv6 address format: '2000::10000'", "_args": ["2000::10000"], + "_kwargs": {}, "_results": { "error": Ip6AddressFormatError, "error_message": ( @@ -829,6 +852,7 @@ def test__net_addr__ip6_address__is_private(self) -> None: { "_description": "Test the IPv6 address format: '2000:::'", "_args": ["2000:::"], + "_kwargs": {}, "_results": { "error": Ip6AddressFormatError, "error_message": ( @@ -839,6 +863,7 @@ def test__net_addr__ip6_address__is_private(self) -> None: { "_description": "Test the IPv6 address format: '2000;:1'", "_args": ["2000;:1"], + "_kwargs": {}, "_results": { "error": Ip6AddressFormatError, "error_message": ( @@ -854,6 +879,7 @@ def test__net_addr__ip6_address__is_private(self) -> None: "_args": [ b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" ], + "_kwargs": {}, "_results": { "error": Ip6AddressFormatError, "error_message": ( @@ -870,6 +896,7 @@ def test__net_addr__ip6_address__is_private(self) -> None: "_args": [ b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" ], + "_kwargs": {}, "_results": { "error": Ip6AddressFormatError, "error_message": ( @@ -881,6 +908,7 @@ def test__net_addr__ip6_address__is_private(self) -> None: { "_description": "Test the IPv6 address format: -1", "_args": [-1], + "_kwargs": {}, "_results": { "error": Ip6AddressFormatError, "error_message": ("The IPv6 address format is invalid: -1"), @@ -891,6 +919,7 @@ def test__net_addr__ip6_address__is_private(self) -> None: "Test the IPv6 address format: 340282366920938463463374607431768211456" ), "_args": [340282366920938463463374607431768211456], + "_kwargs": {}, "_results": { "error": Ip6AddressFormatError, "error_message": ( @@ -901,6 +930,7 @@ def test__net_addr__ip6_address__is_private(self) -> None: { "_description": "Test the IPv6 address format: Ip4Address()", "_args": [Ip4Address()], + "_kwargs": {}, "_results": { "error": Ip6AddressFormatError, "error_message": "The IPv6 address format is invalid: Ip4Address('0.0.0.0')", @@ -909,6 +939,7 @@ def test__net_addr__ip6_address__is_private(self) -> None: { "_description": "Test the IPv6 address format: {}", "_args": [{}], + "_kwargs": {}, "_results": { "error": Ip6AddressFormatError, "error_message": "The IPv6 address format is invalid: {}", @@ -917,6 +948,7 @@ def test__net_addr__ip6_address__is_private(self) -> None: { "_description": "Test the IPv6 address format: 1.1", "_args": [1.1], + "_kwargs": {}, "_results": { "error": Ip6AddressFormatError, "error_message": "The IPv6 address format is invalid: 1.1", @@ -931,6 +963,7 @@ class TestNetAddrIp6AddressErrors(TestCase): _description: str _args: dict[str, Any] + _kwargs: dict[str, Any] _results: dict[str, Any] def test__net_addr__ip6_address__errors(self) -> None: @@ -939,7 +972,7 @@ def test__net_addr__ip6_address__errors(self) -> None: """ with self.assertRaises(self._results["error"]) as error: - Ip6Address(*self._args) + Ip6Address(*self._args, **self._kwargs) self.assertEqual( str(error.exception), diff --git a/tests/unit/lib/net_addr/test__ip6_mask.py b/tests/unit/lib/net_addr/test__ip6_mask.py index 92aad15b..9afca3b1 100644 --- a/tests/unit/lib/net_addr/test__ip6_mask.py +++ b/tests/unit/lib/net_addr/test__ip6_mask.py @@ -46,6 +46,7 @@ { "_description": "Test the IPv6 mask: '/0' (str)", "_args": ["/0"], + "_kwargs": {}, "_results": { "__len__": 0, "__str__": "/0", @@ -61,6 +62,7 @@ { "_description": "Test the IPv6 mask: None (str)", "_args": [None], + "_kwargs": {}, "_results": { "__len__": 0, "__str__": "/0", @@ -76,6 +78,7 @@ { "_description": "Test the IPv6 mask: '/8' (str)", "_args": ["/8"], + "_kwargs": {}, "_results": { "__len__": 8, "__str__": "/8", @@ -91,6 +94,7 @@ { "_description": "Test the IPv6 mask: '/16' (str)", "_args": ["/16"], + "_kwargs": {}, "_results": { "__len__": 16, "__str__": "/16", @@ -106,6 +110,7 @@ { "_description": "Test the IPv6 mask: '/16' (Ip6Mask)", "_args": [Ip6Mask("/16")], + "_kwargs": {}, "_results": { "__len__": 16, "__str__": "/16", @@ -121,6 +126,7 @@ { "_description": "Test the IPv6 mask: '/16' (Ip6Mask)", "_args": [Ip6Mask("/16")], + "_kwargs": {}, "_results": { "__len__": 16, "__str__": "/16", @@ -138,6 +144,7 @@ "_args": [ b"\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ], + "_kwargs": {}, "_results": { "__len__": 16, "__str__": "/16", @@ -157,6 +164,7 @@ b"\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ) ], + "_kwargs": {}, "_results": { "__len__": 16, "__str__": "/16", @@ -176,6 +184,7 @@ b"\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ) ], + "_kwargs": {}, "_results": { "__len__": 16, "__str__": "/16", @@ -191,6 +200,7 @@ { "_description": "Test the IPv6 mask: '/16' (int)", "_args": [340277174624079928635746076935438991360], + "_kwargs": {}, "_results": { "__len__": 16, "__str__": "/16", @@ -206,6 +216,7 @@ { "_description": "Test the IPv6 mask: '/24' (str)", "_args": ["/24"], + "_kwargs": {}, "_results": { "__len__": 24, "__str__": "/24", @@ -221,6 +232,7 @@ { "_description": "Test the IPv6 mask: '/32' (str)", "_args": ["/32"], + "_kwargs": {}, "_results": { "__len__": 32, "__str__": "/32", @@ -236,6 +248,7 @@ { "_description": "Test the IPv6 mask: '/40' (str)", "_args": ["/40"], + "_kwargs": {}, "_results": { "__len__": 40, "__str__": "/40", @@ -251,6 +264,7 @@ { "_description": "Test the IPv6 mask: '/48' (str)", "_args": ["/48"], + "_kwargs": {}, "_results": { "__len__": 48, "__str__": "/48", @@ -266,6 +280,7 @@ { "_description": "Test the IPv6 mask: '/56' (str)", "_args": ["/56"], + "_kwargs": {}, "_results": { "__len__": 56, "__str__": "/56", @@ -281,6 +296,7 @@ { "_description": "Test the IPv6 mask: '/64' (str)", "_args": ["/64"], + "_kwargs": {}, "_results": { "__len__": 64, "__str__": "/64", @@ -296,6 +312,7 @@ { "_description": "Test the IPv6 mask: '/72' (str)", "_args": ["/72"], + "_kwargs": {}, "_results": { "__len__": 72, "__str__": "/72", @@ -311,6 +328,7 @@ { "_description": "Test the IPv6 mask: '/80' (str)", "_args": ["/80"], + "_kwargs": {}, "_results": { "__len__": 80, "__str__": "/80", @@ -326,6 +344,7 @@ { "_description": "Test the IPv6 mask: '/88' (str)", "_args": ["/88"], + "_kwargs": {}, "_results": { "__len__": 88, "__str__": "/88", @@ -341,6 +360,7 @@ { "_description": "Test the IPv6 mask: '/96' (str)", "_args": ["/96"], + "_kwargs": {}, "_results": { "__len__": 96, "__str__": "/96", @@ -356,6 +376,7 @@ { "_description": "Test the IPv6 mask: '/104' (str)", "_args": ["/104"], + "_kwargs": {}, "_results": { "__len__": 104, "__str__": "/104", @@ -371,6 +392,7 @@ { "_description": "Test the IPv6 mask: '/112' (str)", "_args": ["/112"], + "_kwargs": {}, "_results": { "__len__": 112, "__str__": "/112", @@ -386,6 +408,7 @@ { "_description": "Test the IPv6 mask: '/120' (str)", "_args": ["/120"], + "_kwargs": {}, "_results": { "__len__": 120, "__str__": "/120", @@ -401,6 +424,7 @@ { "_description": "Test the IPv6 mask: '/128' (str)", "_args": ["/128"], + "_kwargs": {}, "_results": { "__len__": 128, "__str__": "/128", @@ -422,6 +446,7 @@ class TestNetAddrIp6Mask(TestCase): _description: str _args: dict[str, Any] + _kwargs: dict[str, Any] _results: dict[str, Any] def setUp(self) -> None: @@ -429,7 +454,7 @@ def setUp(self) -> None: Initialize the IPv6 mask object with testcase arguments. """ - self._ip6_mask = Ip6Mask(*self._args) + self._ip6_mask = Ip6Mask(*self._args, **self._kwargs) def test__net_addr__ip6_mask__len(self) -> None: """ @@ -546,6 +571,7 @@ def test__net_addr__ip6_mask__is_ip6(self) -> None: { "_description": "Test the IPv6 mask format: '64'", "_args": ["64"], + "_kwargs": {}, "_results": { "error": Ip6MaskFormatError, "error_message": "The IPv6 mask format is invalid: '64'", @@ -554,6 +580,7 @@ def test__net_addr__ip6_mask__is_ip6(self) -> None: { "_description": "Test the IPv6 mask format: '/-1'", "_args": ["/-1"], + "_kwargs": {}, "_results": { "error": Ip6MaskFormatError, "error_message": "The IPv6 mask format is invalid: '/-1'", @@ -562,6 +589,7 @@ def test__net_addr__ip6_mask__is_ip6(self) -> None: { "_description": "Test the IPv6 mask format: '/129'", "_args": ["/129"], + "_kwargs": {}, "_results": { "error": Ip6MaskFormatError, "error_message": "The IPv6 mask format is invalid: '/129'", @@ -570,6 +598,7 @@ def test__net_addr__ip6_mask__is_ip6(self) -> None: { "_description": "Test the IPv6 mask: b'ffff:ffff:ffff:ffff:ffff:ffff:ffff'", "_args": [b"ffff:ffff:ffff:ffff:ffff:ffff:ffff"], + "_kwargs": {}, "_results": { "error": Ip6MaskFormatError, "error_message": ( @@ -580,6 +609,7 @@ def test__net_addr__ip6_mask__is_ip6(self) -> None: { "_description": "Test the IPv6 mask: b'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'", "_args": [b"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"], + "_kwargs": {}, "_results": { "error": Ip6MaskFormatError, "error_message": ( @@ -590,6 +620,7 @@ def test__net_addr__ip6_mask__is_ip6(self) -> None: { "_description": "Test the IPv6 mask: -1", "_args": [-1], + "_kwargs": {}, "_results": { "error": Ip6MaskFormatError, "error_message": "The IPv6 mask format is invalid: -1", @@ -598,6 +629,7 @@ def test__net_addr__ip6_mask__is_ip6(self) -> None: { "_description": "Test the IPv6 mask: 340282366920938463463374607431768211456", "_args": [340282366920938463463374607431768211456], + "_kwargs": {}, "_results": { "error": Ip6MaskFormatError, "error_message": ( @@ -608,6 +640,7 @@ def test__net_addr__ip6_mask__is_ip6(self) -> None: { "_description": "Test the IPv6 mask format: Ip4Mask()", "_args": [Ip4Mask()], + "_kwargs": {}, "_results": { "error": Ip6MaskFormatError, "error_message": ( @@ -618,6 +651,7 @@ def test__net_addr__ip6_mask__is_ip6(self) -> None: { "_description": "Test the IPv4 mask format: {}", "_args": [{}], + "_kwargs": {}, "_results": { "error": Ip6MaskFormatError, "error_message": "The IPv6 mask format is invalid: {}", @@ -626,6 +660,7 @@ def test__net_addr__ip6_mask__is_ip6(self) -> None: { "_description": "Test the IPv4 address format: 1.1", "_args": [1.1], + "_kwargs": {}, "_results": { "error": Ip6MaskFormatError, "error_message": "The IPv6 mask format is invalid: 1.1", @@ -640,6 +675,7 @@ class TestNetAddrIp4MaskErrors(TestCase): _description: str _args: dict[str, Any] + _kwargs: dict[str, Any] _results: dict[str, Any] def test__net_addr__ip6_mask__errors(self) -> None: @@ -648,7 +684,7 @@ def test__net_addr__ip6_mask__errors(self) -> None: """ with self.assertRaises(self._results["error"]) as error: - Ip6Mask(*self._args) + Ip6Mask(*self._args, **self._kwargs) self.assertEqual( str(error.exception), diff --git a/tests/unit/lib/net_addr/test__mac_address.py b/tests/unit/lib/net_addr/test__mac_address.py index 30373305..e36696cc 100644 --- a/tests/unit/lib/net_addr/test__mac_address.py +++ b/tests/unit/lib/net_addr/test__mac_address.py @@ -46,6 +46,7 @@ { "_description": "Test the MAC address: 00:00:00:00:00:00 (str)", "_args": ["00:00:00:00:00:00"], + "_kwargs": {}, "_results": { "__str__": "00:00:00:00:00:00", "__repr__": "MacAddress('00:00:00:00:00:00')", @@ -64,6 +65,7 @@ { "_description": "Test the MAC address: 00:00:00:00:00:00 (None)", "_args": [None], + "_kwargs": {}, "_results": { "__str__": "00:00:00:00:00:00", "__repr__": "MacAddress('00:00:00:00:00:00')", @@ -82,6 +84,7 @@ { "_description": "Test the MAC address: 02:03:04:aa:bb:cc (str)", "_args": ["02:03:04:aa:bb:cc"], + "_kwargs": {}, "_results": { "__str__": "02:03:04:aa:bb:cc", "__repr__": "MacAddress('02:03:04:aa:bb:cc')", @@ -100,6 +103,7 @@ { "_description": "Test the MAC address: 02:03:04:aa:bb:cc (str uppercase)", "_args": ["02:03:04:AA:BB:CC"], + "_kwargs": {}, "_results": { "__str__": "02:03:04:aa:bb:cc", "__repr__": "MacAddress('02:03:04:aa:bb:cc')", @@ -118,6 +122,7 @@ { "_description": "Test the MAC address: 02:03:04:aa:bb:cc (bytes)", "_args": [b"\x02\x03\x04\xaa\xbb\xcc"], + "_kwargs": {}, "_results": { "__str__": "02:03:04:aa:bb:cc", "__repr__": "MacAddress('02:03:04:aa:bb:cc')", @@ -136,6 +141,7 @@ { "_description": "Test the MAC address: 02:03:04:aa:bb:cc (bytearray)", "_args": [bytearray(b"\x02\x03\x04\xaa\xbb\xcc")], + "_kwargs": {}, "_results": { "__str__": "02:03:04:aa:bb:cc", "__repr__": "MacAddress('02:03:04:aa:bb:cc')", @@ -154,6 +160,7 @@ { "_description": "Test the MAC address: 02:03:04:aa:bb:cc (memoryview)", "_args": [memoryview(b"\x02\x03\x04\xaa\xbb\xcc")], + "_kwargs": {}, "_results": { "__str__": "02:03:04:aa:bb:cc", "__repr__": "MacAddress('02:03:04:aa:bb:cc')", @@ -172,6 +179,7 @@ { "_description": "Test the MAC address: 02:03:04:aa:bb:cc (MacAddress)", "_args": [MacAddress("02:03:04:aa:bb:cc")], + "_kwargs": {}, "_results": { "__str__": "02:03:04:aa:bb:cc", "__repr__": "MacAddress('02:03:04:aa:bb:cc')", @@ -190,6 +198,7 @@ { "_description": "Test the MAC address: 02:03:04:aa:bb:cc (int)", "_args": [2211986455500], + "_kwargs": {}, "_results": { "__str__": "02:03:04:aa:bb:cc", "__repr__": "MacAddress('02:03:04:aa:bb:cc')", @@ -208,6 +217,7 @@ { "_description": "Test the MAC address: 01:00:5e:01:02:03 (str)", "_args": ["01:00:5e:01:02:03"], + "_kwargs": {}, "_results": { "__str__": "01:00:5e:01:02:03", "__repr__": "MacAddress('01:00:5e:01:02:03')", @@ -226,6 +236,7 @@ { "_description": "Test the MAC address: 33:33:00:01:02:03 (str)", "_args": ["33:33:00:01:02:03"], + "_kwargs": {}, "_results": { "__str__": "33:33:00:01:02:03", "__repr__": "MacAddress('33:33:00:01:02:03')", @@ -244,6 +255,7 @@ { "_description": "Test the MAC address: 33:33:00:01:02:03 (str)", "_args": ["33:33:00:01:02:03"], + "_kwargs": {}, "_results": { "__str__": "33:33:00:01:02:03", "__repr__": "MacAddress('33:33:00:01:02:03')", @@ -262,6 +274,7 @@ { "_description": "Test the MAC address: 33:33:ff:01:02:03 (str)", "_args": ["33:33:ff:01:02:03"], + "_kwargs": {}, "_results": { "__str__": "33:33:ff:01:02:03", "__repr__": "MacAddress('33:33:ff:01:02:03')", @@ -280,6 +293,7 @@ { "_description": "Test the MAC address: ff:ff:ff:ff:ff:ff (str)", "_args": ["ff:ff:ff:ff:ff:ff"], + "_kwargs": {}, "_results": { "__str__": "ff:ff:ff:ff:ff:ff", "__repr__": "MacAddress('ff:ff:ff:ff:ff:ff')", @@ -304,6 +318,7 @@ class TestNetAddrMacAddress(TestCase): _description: str _args: dict[str, Any] + _kwargs: dict[str, Any] _results: dict[str, Any] def setUp(self) -> None: @@ -311,7 +326,7 @@ def setUp(self) -> None: Initialize the MAC address object with testcase arguments. """ - self._mac_address = MacAddress(*self._args) + self._mac_address = MacAddress(*self._args, **self._kwargs) def test__net_addr__mac_address__str(self) -> None: """ @@ -466,6 +481,7 @@ def test__net_addr__mac_address__is_broadcast(self) -> None: { "_description": "Test the MAC address format: '01:23:45:ab:cd'", "_args": ["01:23:45:ab:cd"], + "_kwargs": {}, "_results": { "error": MacAddressFormatError, "error_message": ( @@ -476,6 +492,7 @@ def test__net_addr__mac_address__is_broadcast(self) -> None: { "_description": "Test the MAC address format: '01:23:45:ab:cd:ef:01'", "_args": ["01:23:45:ab:cd:ef:01"], + "_kwargs": {}, "_results": { "error": MacAddressFormatError, "error_message": ( @@ -486,6 +503,7 @@ def test__net_addr__mac_address__is_broadcast(self) -> None: { "_description": "Test the MAC address format: '01:23:45:ab:cd:eg'", "_args": ["01:23:45:ab:cd:eg"], + "_kwargs": {}, "_results": { "error": MacAddressFormatError, "error_message": ( @@ -496,6 +514,7 @@ def test__net_addr__mac_address__is_broadcast(self) -> None: { "_description": "Test the MAC address format: b'\x01\x23\x45\xab\xcd'", "_args": [b"\x01\x23\x45\xab\xcd"], + "_kwargs": {}, "_results": { "error": MacAddressFormatError, "error_message": ( @@ -506,6 +525,7 @@ def test__net_addr__mac_address__is_broadcast(self) -> None: { "_description": "Test the MAC address format: b'\x01\x23\x45\xab\xcd\xef\x01'", "_args": [b"\x01\x23\x45\xab\xcd\xef\x01"], + "_kwargs": {}, "_results": { "error": MacAddressFormatError, "error_message": ( @@ -516,6 +536,7 @@ def test__net_addr__mac_address__is_broadcast(self) -> None: { "_description": "Test the MAC address format: -1", "_args": [-1], + "_kwargs": {}, "_results": { "error": MacAddressFormatError, "error_message": "The MAC address format is invalid: -1", @@ -524,6 +545,7 @@ def test__net_addr__mac_address__is_broadcast(self) -> None: { "_description": "Test the MAC address format: 281474976710656", "_args": [281474976710656], + "_kwargs": {}, "_results": { "error": MacAddressFormatError, "error_message": "The MAC address format is invalid: 281474976710656", @@ -532,6 +554,7 @@ def test__net_addr__mac_address__is_broadcast(self) -> None: { "_description": "Test the MAC address format: {}", "_args": [{}], + "_kwargs": {}, "_results": { "error": MacAddressFormatError, "error_message": "The MAC address format is invalid: {}", @@ -540,6 +563,7 @@ def test__net_addr__mac_address__is_broadcast(self) -> None: { "_description": "Test the MAC address format: 1.1", "_args": [1.1], + "_kwargs": {}, "_results": { "error": MacAddressFormatError, "error_message": "The MAC address format is invalid: 1.1", @@ -554,6 +578,7 @@ class TestNetAddrMacAddressErrors(TestCase): _description: str _args: dict[str, Any] + _kwargs: dict[str, Any] _results: dict[str, Any] def test__net_addr__mac_address__errors(self) -> None: @@ -562,7 +587,7 @@ def test__net_addr__mac_address__errors(self) -> None: """ with self.assertRaises(self._results["error"]) as error: - MacAddress(*self._args) + MacAddress(*self._args, **self._kwargs) self.assertEqual( str(error.exception), diff --git a/tests/unit/lib/test__lib__inet_cksum.py b/tests/unit/lib/test__lib__inet_cksum.py index d3f59824..10d32986 100644 --- a/tests/unit/lib/test__lib__inet_cksum.py +++ b/tests/unit/lib/test__lib__inet_cksum.py @@ -45,7 +45,8 @@ [ { "_description": "Compute checksum.", - "_args": { + "_args": [], + "_kwargs": { "data": ( b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F" * 80 @@ -56,7 +57,8 @@ }, { "_description": "Compute checksum.", - "_args": { + "_args": [], + "_kwargs": { "data": b"\xFF" * 1500, "init": 0, }, @@ -64,7 +66,8 @@ }, { "_description": "Compute checksum.", - "_args": { + "_args": [], + "_kwargs": { "data": b"\x00" * 1500, "init": 0, }, @@ -72,7 +75,8 @@ }, { "_description": "Compute checksum.", - "_args": { + "_args": [], + "_kwargs": { "data": b"\xF7\x24\x09" * 100 + b"\x35\x67\x0F\x00" * 250, "init": 0, }, @@ -80,7 +84,8 @@ }, { "_description": "Compute checksum.", - "_args": { + "_args": [], + "_kwargs": { "data": ( b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F" * 80 @@ -91,7 +96,8 @@ }, { "_description": "Compute checksum.", - "_args": { + "_args": [], + "_kwargs": { "data": b"\xFF" * 1500, "init": 0x0015, }, @@ -99,7 +105,8 @@ }, { "_description": "Compute checksum.", - "_args": { + "_args": [], + "_kwargs": { "data": b"\x00" * 1500, "init": 0xF3FF, }, @@ -107,7 +114,8 @@ }, { "_description": "Compute checksum.", - "_args": { + "_args": [], + "_kwargs": { "data": b"\xF7\x24\x09" * 100 + b"\x35\x67\x0F\x00" * 250, "init": 0x7314, }, @@ -115,7 +123,8 @@ }, { "_description": "Compute checksum.", - "_args": { + "_args": [], + "_kwargs": { "data": b"\x07" * 9999, "init": 0xA3DC, }, @@ -129,7 +138,8 @@ class TestLibInetChecksum(TestCase): """ _description: str - _args: dict[str, Any] + _args: list[Any] + _kwargs: dict[str, Any] _results: dict[str, Any] def test__lib__inet_cksum(self) -> None: @@ -138,6 +148,6 @@ def test__lib__inet_cksum(self) -> None: """ self.assertEqual( - inet_cksum(**self._args), + inet_cksum(*self._args, **self._kwargs), self._results["inet_cksum"], )