#NEWLINE# @ mock . patch ( 'nova.db.instance_fault_get_by_instance_uuids' ) #NEWLINE# def test_load_fault( self , mock_get ) : #NEWLINE# #INDENT# fake_fault = test_instance_fault . fake_faults [ 'fake-uuid' ] [ 0 ] #NEWLINE# mock_get . return_value = { #NEWLINE# #INDENT# uuids . load_fault_instance : [ fake_fault ] , #NEWLINE# #UNINDENT# } #NEWLINE# inst = objects . Instance ( context = self . context , uuid = uuids . load_fault_instance ) #NEWLINE# fault = inst . fault #NEWLINE# mock_get . assert_called_once_with ( self . context , [ uuids . load_fault_instance ] ) #NEWLINE# self . assertEqual ( fake_fault [ 'id' ] , fault . id ) #NEWLINE# self . assertNotIn ( 'metadata' , inst . obj_what_changed ( ) )