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

Method test_subnet_of

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

Source from the content-addressed store, hash-verified

674 factory = ipaddress.IPv4Network
675
676 def test_subnet_of(self):
677 # containee left of container
678 self.assertFalse(
679 self.factory('10.0.0.0/30').subnet_of(
680 self.factory('10.0.1.0/24')))
681 # containee inside container
682 self.assertTrue(
683 self.factory('10.0.0.0/30').subnet_of(
684 self.factory('10.0.0.0/24')))
685 # containee right of container
686 self.assertFalse(
687 self.factory('10.0.0.0/30').subnet_of(
688 self.factory('10.0.1.0/24')))
689 # containee larger than container
690 self.assertFalse(
691 self.factory('10.0.1.0/24').subnet_of(
692 self.factory('10.0.0.0/30')))
693
694 def test_supernet_of(self):
695 # containee left of container

Callers

nothing calls this directly

Calls 4

assertFalseMethod · 0.80
subnet_ofMethod · 0.80
assertTrueMethod · 0.80
factoryMethod · 0.45

Tested by

no test coverage detected