@@ -961,20 +961,6 @@ def testInternals(self):
961961 self .assertEqual (128 , ipaddress ._count_righthand_zero_bits (0 , 128 ))
962962 self .assertEqual ("IPv4Network('1.2.3.0/24')" , repr (self .ipv4_network ))
963963
964- def testMissingNetworkVersion (self ):
965- class Broken (ipaddress ._BaseNetwork ):
966- pass
967- broken = Broken ('127.0.0.1' )
968- with self .assertRaisesRegex (NotImplementedError , "Broken.*version" ):
969- broken .version
970-
971- def testMissingAddressClass (self ):
972- class Broken (ipaddress ._BaseNetwork ):
973- pass
974- broken = Broken ('127.0.0.1' )
975- with self .assertRaisesRegex (NotImplementedError , "Broken.*address" ):
976- broken ._address_class
977-
978964 def testGetNetwork (self ):
979965 self .assertEqual (int (self .ipv4_network .network_address ), 16909056 )
980966 self .assertEqual (str (self .ipv4_network .network_address ), '1.2.3.0' )
@@ -1986,25 +1972,22 @@ def testWithStar(self):
19861972
19871973 def testNetworkElementCaching (self ):
19881974 # V4 - make sure we're empty
1989- self .assertNotIn ('network_address' , self .ipv4_network ._cache )
1990- self .assertNotIn ('broadcast_address' , self .ipv4_network ._cache )
1991- self .assertNotIn ('hostmask' , self .ipv4_network ._cache )
1975+ self .assertNotIn ('broadcast_address' , self .ipv4_network .__dict__ )
1976+ self .assertNotIn ('hostmask' , self .ipv4_network .__dict__ )
19921977
19931978 # V4 - populate and test
1994- self .assertEqual (self .ipv4_network .network_address ,
1995- ipaddress .IPv4Address ('1.2.3.0' ))
19961979 self .assertEqual (self .ipv4_network .broadcast_address ,
19971980 ipaddress .IPv4Address ('1.2.3.255' ))
19981981 self .assertEqual (self .ipv4_network .hostmask ,
19991982 ipaddress .IPv4Address ('0.0.0.255' ))
20001983
20011984 # V4 - check we're cached
2002- self .assertIn ('broadcast_address' , self .ipv4_network ._cache )
2003- self .assertIn ('hostmask' , self .ipv4_network ._cache )
1985+ self .assertIn ('broadcast_address' , self .ipv4_network .__dict__ )
1986+ self .assertIn ('hostmask' , self .ipv4_network .__dict__ )
20041987
20051988 # V6 - make sure we're empty
2006- self .assertNotIn ('broadcast_address' , self .ipv6_network ._cache )
2007- self .assertNotIn ('hostmask' , self .ipv6_network ._cache )
1989+ self .assertNotIn ('broadcast_address' , self .ipv6_network .__dict__ )
1990+ self .assertNotIn ('hostmask' , self .ipv6_network .__dict__ )
20081991
20091992 # V6 - populate and test
20101993 self .assertEqual (self .ipv6_network .network_address ,
@@ -2024,10 +2007,10 @@ def testNetworkElementCaching(self):
20242007 ipaddress .IPv6Address ('::ffff:ffff:ffff:ffff' ))
20252008
20262009 # V6 - check we're cached
2027- self .assertIn ('broadcast_address' , self .ipv6_network ._cache )
2028- self .assertIn ('hostmask' , self .ipv6_network ._cache )
2029- self .assertIn ('broadcast_address' , self .ipv6_interface .network ._cache )
2030- self .assertIn ('hostmask' , self .ipv6_interface .network ._cache )
2010+ self .assertIn ('broadcast_address' , self .ipv6_network .__dict__ )
2011+ self .assertIn ('hostmask' , self .ipv6_network .__dict__ )
2012+ self .assertIn ('broadcast_address' , self .ipv6_interface .network .__dict__ )
2013+ self .assertIn ('hostmask' , self .ipv6_interface .network .__dict__ )
20312014
20322015 def testTeredo (self ):
20332016 # stolen from wikipedia
0 commit comments