#NEWLINE# def testBPAllInSecondTri( self ) : #NEWLINE# #INDENT# indicator = CareBiharFluff ( ) #NEWLINE# dates = { #NEWLINE# #INDENT# 'bp1_due' : '2013-03-21' , #NEWLINE# 'bp1_done' : '2013-03-21' , #NEWLINE# 'bp1_days_overdue' : '0' , #NEWLINE# 'bp2_due' : '2013-03-22' , #NEWLINE# 'bp2_done' : '2013-03-22' , #NEWLINE# 'bp2_days_overdue' : '0' , #NEWLINE# 'bp3_due' : '2013-03-23' , #NEWLINE# 'bp3_done' : '2013-03-23' , #NEWLINE# 'bp3_days_overdue' : '0' , #NEWLINE# #UNINDENT# } #NEWLINE# case = self . _load_case ( 'test_bihar_bp.json' , dates ) #NEWLINE# indicator . calculate ( case ) #NEWLINE# bp2 = indicator . bp2 #NEWLINE# self . assertEqual ( 3 , len ( bp2 [ 'total' ] ) ) #NEWLINE# [ v1 , v2 , v3 ] = bp2 [ 'total' ] #NEWLINE# self . assertEqual ( date ( 2013 , 3 , 21 ) , v1 [ 'date' ] ) #NEWLINE# self . assertEqual ( date ( 2013 , 3 , 22 ) , v2 [ 'date' ] ) #NEWLINE# self . assertEqual ( date ( 2013 , 3 , 23 ) , v3 [ 'date' ] ) #NEWLINE# for res in bp2 [ 'total' ] : #NEWLINE# #INDENT# self . assertEqual ( 1 , res [ 'value' ] ) #NEWLINE# #UNINDENT# self . assertEqual ( 3 , len ( bp2 [ 'numerator' ] ) ) #NEWLINE# [ v1 , v2 , v3 ] = bp2 [ 'numerator' ] #NEWLINE# self . assertEqual ( date ( 2013 , 3 , 21 ) , v1 [ 'date' ] ) #NEWLINE# self . assertEqual ( date ( 2013 , 3 , 22 ) , v2 [ 'date' ] ) #NEWLINE# self . assertEqual ( date ( 2013 , 3 , 23 ) , v3 [ 'date' ] ) #NEWLINE# for res in bp2 [ 'total' ] : #NEWLINE# #INDENT# self . assertEqual ( 1 , res [ 'value' ] ) #NEWLINE# #UNINDENT# self . assertIndicatorsEmpty ( indicator , vals = ( 'bp3' , 'pnc' , 'ebf' , 'cf' ) )