#NEWLINE# @ mock . patch ( 'nova.objects.instance._expected_cols' ) #NEWLINE# @ mock . patch ( 'nova.db.instance_get_all' ) #NEWLINE# def test_get_all( self , mock_get_all , mock_exp ) : #NEWLINE# #INDENT# fakes = [ self . fake_instance ( 1 ) , self . fake_instance ( 2 ) ] #NEWLINE# mock_get_all . return_value = fakes #NEWLINE# mock_exp . return_value = mock . sentinel . exp_att #NEWLINE# inst_list = objects . InstanceList . get_all ( self . context , expected_attrs = 'fake' ) #NEWLINE# mock_get_all . assert_called_once_with ( self . context , columns_to_join = mock . sentinel . exp_att ) #NEWLINE# for i in range ( 0 , len ( fakes ) ) : #NEWLINE# #INDENT# self . assertIsInstance ( inst_list . objects [ i ] , instance . Instance ) #NEWLINE# self . assertEqual ( fakes [ i ] [ 'uuid' ] , inst_list . objects [ i ] . uuid )