#NEWLINE# def test_stats1( self ) : #NEWLINE# #INDENT# ' Check stats are correct when adding prefix\n        ' #NEWLINE# th = TestHelper ( ) #NEWLINE# p1 = th . add_prefix ( '1.0.0.0/24' , 'assignment' , 'test' ) #NEWLINE# res = Prefix . smart_search ( '1.0.0.0/24' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( 256 , res [ 'result' ] [ 0 ] . total_addresses ) #NEWLINE# self . assertEqual ( 0 , res [ 'result' ] [ 0 ] . used_addresses ) #NEWLINE# self . assertEqual ( 256 , res [ 'result' ] [ 0 ] . free_addresses ) #NEWLINE# p2 = th . add_prefix ( '1.0.0.0/20' , 'reservation' , 'bar' ) #NEWLINE# res = Prefix . smart_search ( '1.0.0.0/20' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( 4096 , res [ 'result' ] [ 0 ] . total_addresses ) #NEWLINE# self . assertEqual ( 256 , p1 [ 'result' ] [ 0 ] . used_addresses ) #NEWLINE# self . assertEqual ( 3840 , res [ 'result' ] [ 0 ] . free_addresses )