bpo-18802: Add more details to ipaddress documentation (GH-6083)

Original patch by Jon Foster and Berker Peksag.
This commit is contained in:
Cheryl Sabella 2018-03-20 20:09:15 -04:00 committed by Xiang Zhang
parent 4be79f2946
commit 5609b78392
3 changed files with 51 additions and 16 deletions

View file

@ -404,6 +404,9 @@ class AddressTestCase_v6(BaseTestCase, CommonTestMixin_v6):
class NetmaskTestMixin_v4(CommonTestMixin_v4):
"""Input validation on interfaces and networks is very similar"""
def test_no_mask(self):
self.assertEqual(str(self.factory('1.2.3.4')), '1.2.3.4/32')
def test_split_netmask(self):
addr = "1.2.3.4/32/24"
with self.assertAddressError("Only one '/' permitted in %r" % addr):