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

Method test_subnet_of

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

Source from the content-addressed store, hash-verified

837 factory = ipaddress.IPv6Network
838
839 def test_subnet_of(self):
840 # containee left of container
841 self.assertFalse(
842 self.factory('2000:999::/56').subnet_of(
843 self.factory('2000:aaa::/48')))
844 # containee inside container
845 self.assertTrue(
846 self.factory('2000:aaa::/56').subnet_of(
847 self.factory('2000:aaa::/48')))
848 # containee right of container
849 self.assertFalse(
850 self.factory('2000:bbb::/56').subnet_of(
851 self.factory('2000:aaa::/48')))
852 # containee larger than container
853 self.assertFalse(
854 self.factory('2000:aaa::/48').subnet_of(
855 self.factory('2000:aaa::/56')))
856
857 self.assertFalse(
858 self.factory('2000:999::%scope/56').subnet_of(
859 self.factory('2000:aaa::%scope/48')))
860 self.assertTrue(
861 self.factory('2000:aaa::%scope/56').subnet_of(
862 self.factory('2000:aaa::%scope/48')))
863
864 def test_supernet_of(self):
865 # 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