From bd5619a85c900d12c859807ad285a6fa9e416c9f Mon Sep 17 00:00:00 2001 From: humbdrag Date: Mon, 24 Jan 2022 21:28:16 +0000 Subject: [PATCH 1/4] bpo-29890: Test IPv*Interface construction with tuple argument --- Lib/test/test_ipaddress.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py index b0605f0be04bb4..6b60c535cc2eaa 100644 --- a/Lib/test/test_ipaddress.py +++ b/Lib/test/test_ipaddress.py @@ -579,6 +579,10 @@ def assertBadAddress(addr, details): assertBadAddress("1.2.3.256", re.escape("256 (> 255)")) def test_valid_netmask(self): + self.assertEqual(str(self.factory(('192.0.2.0', 24))), '192.0.2.0/24') + self.assertEqual(str(self.factory(('192.0.2.0', '24'))), '192.0.2.0/24') + self.assertEqual(str(self.factory(('192.0.2.0', '255.255.255.0'))), + '192.0.2.0/24') self.assertEqual(str(self.factory('192.0.2.0/255.255.255.0')), '192.0.2.0/24') for i in range(0, 33): @@ -739,6 +743,10 @@ def assertBadAddress(addr, details): def test_valid_netmask(self): # We only support CIDR for IPv6, because expanded netmasks are not # standard notation. + self.assertEqual(str(self.factory(('2001:db8::', 32))), + '2001:db8::/32') + self.assertEqual(str(self.factory(('2001:db8::', '32'))), + '2001:db8::/32') self.assertEqual(str(self.factory('2001:db8::/32')), '2001:db8::/32') for i in range(0, 129): # Generate and re-parse the CIDR format (trivial). From 1b70e153b13e50376bb45a2fee9505de6da9592f Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Mon, 24 Jan 2022 21:31:11 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Misc/NEWS.d/next/Tests/2022-01-24-21-31-09.bpo-29890.zEG-ra.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2022-01-24-21-31-09.bpo-29890.zEG-ra.rst diff --git a/Misc/NEWS.d/next/Tests/2022-01-24-21-31-09.bpo-29890.zEG-ra.rst b/Misc/NEWS.d/next/Tests/2022-01-24-21-31-09.bpo-29890.zEG-ra.rst new file mode 100644 index 00000000000000..ad6f3d79cf07d6 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2022-01-24-21-31-09.bpo-29890.zEG-ra.rst @@ -0,0 +1,2 @@ +Adding tests for IPv4Interface and IPv6Interface construction with tuple arguments. +Original patch and tests by louisom. \ No newline at end of file From 5d64b15d378536a0e1d51b4081a35ab9448a5b1b Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Mon, 2 May 2022 14:17:43 -0600 Subject: [PATCH 3/4] Improve NEWS entry --- .../next/Tests/2022-01-24-21-31-09.bpo-29890.zEG-ra.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Tests/2022-01-24-21-31-09.bpo-29890.zEG-ra.rst b/Misc/NEWS.d/next/Tests/2022-01-24-21-31-09.bpo-29890.zEG-ra.rst index ad6f3d79cf07d6..38a06a2f9b6be2 100644 --- a/Misc/NEWS.d/next/Tests/2022-01-24-21-31-09.bpo-29890.zEG-ra.rst +++ b/Misc/NEWS.d/next/Tests/2022-01-24-21-31-09.bpo-29890.zEG-ra.rst @@ -1,2 +1,2 @@ -Adding tests for IPv4Interface and IPv6Interface construction with tuple arguments. -Original patch and tests by louisom. \ No newline at end of file +Add tests for :class:`ipaddress.IPv4Interface` and :class:`ipaddress.IPv6Interface` construction with tuple arguments. +Original patch and tests by louisom. From 6eec837e81886ab34e80b39b081f9cd0d50fc29d Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 3 May 2022 09:31:15 -0600 Subject: [PATCH 4/4] fix whitespace --- Lib/test/test_ipaddress.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py index 6b60c535cc2eaa..9753802ae7a644 100644 --- a/Lib/test/test_ipaddress.py +++ b/Lib/test/test_ipaddress.py @@ -743,7 +743,7 @@ def assertBadAddress(addr, details): def test_valid_netmask(self): # We only support CIDR for IPv6, because expanded netmasks are not # standard notation. - self.assertEqual(str(self.factory(('2001:db8::', 32))), + self.assertEqual(str(self.factory(('2001:db8::', 32))), '2001:db8::/32') self.assertEqual(str(self.factory(('2001:db8::', '32'))), '2001:db8::/32')