#NEWLINE# @ given ( start_action_messages , message_dicts , text ( ) , text ( ) , integers ( min_value = 2 ) ) #NEWLINE# def test_failed_end( self , start_message , end_message_dict , exception , reason , n ) : #NEWLINE# #INDENT# '\n        A L{WrittenAction} can be constructed with just a start message and an end\n        message: in this case, an end message that indicates that the action\n        failed.\n\n        Such an action inherits the C{end_time} from the end message, has a\n        C{status} of C{FAILED_STATUS}, and an C{exception} and C{reason} that\n        match the raised exception.\n        ' #NEWLINE# end_message = written_from_pmap ( union ( end_message_dict , { #NEWLINE# #INDENT# ACTION_STATUS_FIELD : FAILED_STATUS , #NEWLINE# ACTION_TYPE_FIELD : start_message . contents [ ACTION_TYPE_FIELD ] , #NEWLINE# TASK_UUID_FIELD : start_message . task_uuid , #NEWLINE# TASK_LEVEL_FIELD : sibling_task_level ( start_message , n ) , #NEWLINE# EXCEPTION_FIELD : exception , #NEWLINE# REASON_FIELD : reason , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# action = WrittenAction . from_messages ( start_message , end_message = end_message ) #NEWLINE# self . assertThat ( action , MatchesStructure . byEquality ( action_type = start_message . contents [ ACTION_TYPE_FIELD ] , status = FAILED_STATUS , task_uuid = start_message . task_uuid , task_level = start_message . task_level . parent ( ) , start_time = start_message . timestamp , children = pvector ( [ ] ) , end_time = end_message . timestamp , reason = reason , exception = exception ) )