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

Method testSubnet2

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

Source from the content-addressed store, hash-verified

1615 self.assertEqual(subnets1, subnets2)
1616
1617 def testSubnet2(self):
1618 ips = [str(x) for x in self.ipv4_network.subnets(2)]
1619 self.assertEqual(
1620 ips,
1621 ['1.2.3.0/26', '1.2.3.64/26', '1.2.3.128/26', '1.2.3.192/26'])
1622
1623 ipsv6 = [str(x) for x in self.ipv6_network.subnets(2)]
1624 self.assertEqual(
1625 ipsv6,
1626 ['2001:658:22a:cafe::/66',
1627 '2001:658:22a:cafe:4000::/66',
1628 '2001:658:22a:cafe:8000::/66',
1629 '2001:658:22a:cafe:c000::/66'])
1630
1631 def testGetSubnets3(self):
1632 subnets = [str(x) for x in self.ipv4_network.subnets(8)]

Callers

nothing calls this directly

Calls 3

strFunction · 0.85
subnetsMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected