#NEWLINE# def test_stats4( self ) : #NEWLINE# #INDENT# ' Check total stats are correct when modifying child prefixes in pool\n        ' #NEWLINE# th = TestHelper ( ) #NEWLINE# pool1 = th . add_pool ( 'test' , 'assignment' , 31 , 112 ) #NEWLINE# p1 = th . add_prefix ( '1.0.0.0/24' , 'reservation' , 'test' , pool_id = pool1 . id ) #NEWLINE# p2 = th . add_prefix ( '2001:db8::/48' , 'reservation' , 'test' , pool_id = pool1 . id ) #NEWLINE# pc1 = th . add_prefix_from_pool ( pool1 , 4 , 'foo' ) #NEWLINE# pc2 = th . add_prefix_from_pool ( pool1 , 6 , 'foo' ) #NEWLINE# pc1 . prefix = '1.0.0.128/25' #NEWLINE# pc1 . save ( ) #NEWLINE# pc2 . prefix = '2001:db8:0:1::/64' #NEWLINE# pc2 . save ( ) #NEWLINE# res = Pool . list ( { #NEWLINE# #INDENT# 'id' : pool1 . id , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( 1 , res [ 0 ] . member_prefixes_v4 ) #NEWLINE# self . assertEqual ( 1 , res [ 0 ] . used_prefixes_v4 ) #NEWLINE# self . assertEqual ( 64 , res [ 0 ] . free_prefixes_v4 ) #NEWLINE# self . assertEqual ( 65 , res [ 0 ] . total_prefixes_v4 ) #NEWLINE# self . assertEqual ( 256 , res [ 0 ] . total_addresses_v4 ) #NEWLINE# self . assertEqual ( 128 , res [ 0 ] . used_addresses_v4 ) #NEWLINE# self . assertEqual ( 128 , res [ 0 ] . free_addresses_v4 ) #NEWLINE# self . assertEqual ( 1 , res [ 0 ] . member_prefixes_v6 ) #NEWLINE# self . assertEqual ( 1 , res [ 0 ] . used_prefixes_v6 ) #NEWLINE# self . assertEqual ( 18446462598732840960 , res [ 0 ] . free_prefixes_v6 ) #NEWLINE# self . assertEqual ( 18446462598732840961 , res [ 0 ] . total_prefixes_v6 ) #NEWLINE# self . assertEqual ( 1208925819614629174706176 , pool1 [ 0 ] . total_addresses_v6 ) #NEWLINE# self . assertEqual ( 18446744073709551616 , res [ 0 ] . used_addresses_v6 ) #NEWLINE# self . assertEqual ( 1208907372870555465154560 , res [ 0 ] . free_addresses_v6 )