MCPcopy Index your code
hub / github.com/python/cpython / testGetSubnetForSingle32

Method testGetSubnetForSingle32

Lib/test/test_ipaddress.py:1597–1602  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1595 self.assertEqual(list(self.ipv6_scoped_network.subnets())[0].prefixlen, 65)
1596
1597 def testGetSubnetForSingle32(self):
1598 ip = ipaddress.IPv4Network('1.2.3.4/32')
1599 subnets1 = [str(x) for x in ip.subnets()]
1600 subnets2 = [str(x) for x in ip.subnets(2)]
1601 self.assertEqual(subnets1, ['1.2.3.4/32'])
1602 self.assertEqual(subnets1, subnets2)
1603
1604 def testGetSubnetForSingle128(self):
1605 ip = ipaddress.IPv6Network('::1/128')

Callers

nothing calls this directly

Calls 3

strFunction · 0.85
subnetsMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected