def test_initializationLogging(self, logger): """ The initialization of the L{IFiniteStateMachine} created by L{constructFiniteStateMachine} is logged. """ constructFiniteStateMachine( Input, Output, MoreState, TRANSITIONS, MoreState.amber, [Gravenstein], {Output.aardvark: IFood}, MethodSuffixOutputer(AnimalWorld([])), logger) self.assertTrue( issuperset(logger.messages[0], { u"fsm_identifier": u"<AnimalWorld>", u"fsm_state": u"<MoreState=amber>", u"action_status": u"started", u"action_type": u"fsm:initialize", }))
def test_initializationLogging(self, logger): """ The initialization of the L{IFiniteStateMachine} created by L{constructFiniteStateMachine} is logged. """ constructFiniteStateMachine(Input, Output, MoreState, TRANSITIONS, MoreState.amber, [Gravenstein], {Output.aardvark: IFood}, MethodSuffixOutputer(AnimalWorld([])), logger) self.assertTrue( issuperset( logger.messages[0], { u"fsm_identifier": u"<AnimalWorld>", u"fsm_state": u"<MoreState=amber>", u"action_status": u"started", u"action_type": u"fsm:initialize", }))
def test_terminalLogging(self, logger): """ When the L{IFiniteStateMachine} enters a terminal state the initialization action is finished successfully. """ fsm = constructFiniteStateMachine( Input, Output, MoreState, TRANSITIONS, MoreState.amber, [Gravenstein], {Output.aardvark: IFood}, MethodSuffixOutputer(AnimalWorld([])), logger) fsm.receive(Gravenstein()) self.assertTrue( issuperset(logger.messages[3], { u"fsm_terminal_state": u"<MoreState=blue>", # Prove it associates with the initialization action. u"action_type": u"fsm:initialize", u"action_status": u"succeeded", u"task_uuid": logger.messages[0][u"task_uuid"], u"task_level": u"/", }))
def test_terminalLogging(self, logger): """ When the L{IFiniteStateMachine} enters a terminal state the initialization action is finished successfully. """ fsm = constructFiniteStateMachine( Input, Output, MoreState, TRANSITIONS, MoreState.amber, [Gravenstein], {Output.aardvark: IFood}, MethodSuffixOutputer(AnimalWorld([])), logger) fsm.receive(Gravenstein()) self.assertTrue( issuperset( logger.messages[3], { u"fsm_terminal_state": u"<MoreState=blue>", # Prove it associates with the initialization action. u"action_type": u"fsm:initialize", u"action_status": u"succeeded", u"task_uuid": logger.messages[0][u"task_uuid"], u"task_level": u"/", }))