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

Method testGetSubnets

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

Source from the content-addressed store, hash-verified

1583 new_prefix=68))
1584
1585 def testGetSubnets(self):
1586 self.assertEqual(list(self.ipv4_network.subnets())[0].prefixlen, 25)
1587 self.assertEqual(str(list(
1588 self.ipv4_network.subnets())[0].network_address),
1589 '1.2.3.0')
1590 self.assertEqual(str(list(
1591 self.ipv4_network.subnets())[1].network_address),
1592 '1.2.3.128')
1593
1594 self.assertEqual(list(self.ipv6_network.subnets())[0].prefixlen, 65)
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')

Callers

nothing calls this directly

Calls 4

listClass · 0.85
strFunction · 0.85
subnetsMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected