#NEWLINE# def test_get_extended_cost_matrix( self ) : #NEWLINE# #INDENT# fake_hosts = self . _get_all_hosts ( ) #NEWLINE# fake_hosts = list ( fake_hosts ) #NEWLINE# fake_filter_properties = { #NEWLINE# #INDENT# 'context' : self . context , #NEWLINE# 'num_instances' : 3 , #NEWLINE# #UNINDENT# } #NEWLINE# fake_cost = self . cost_classes [ 0 ] ( ) #NEWLINE# expected_x_cost_mat = [ [ 0.0 , 0.2 , 0.4 , 0.6 ] , [ 0.2 , 0.4 , 0.6 , 0.8 ] , [ 0.4 , 0.6 , 0.8 , 1.0 ] , [ 1.0 , 1.2 , 1.4 , 1.6 ] ] #NEWLINE# x_cost_mat = fake_cost . get_extended_cost_matrix ( fake_hosts , fake_hosts ) #NEWLINE# expected_x_cost_mat = [ [ round ( val , 4 ) for val in row ] for row in expected_x_cost_mat ] #NEWLINE# x_cost_mat = [ [ round ( val , 4 ) for val in row ] for row in x_cost_mat ] #NEWLINE# self . assertEqual ( expected_x_cost_mat , x_cost_mat )