From 5c5b89cda2d3ff8f1b233923be0729db9b831122 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Fri, 23 Jan 2015 17:10:34 -0500 Subject: [PATCH 1/3] Eliot 0.6 changes the way task levels are structured, so don't hard code it. --- machinist/test/test_fsm.py | 1 - 1 file changed, 1 deletion(-) diff --git a/machinist/test/test_fsm.py b/machinist/test/test_fsm.py index 27e9446..72d8966 100644 --- a/machinist/test/test_fsm.py +++ b/machinist/test/test_fsm.py @@ -868,7 +868,6 @@ def test_terminalLogging(self, logger): u"action_type": u"fsm:initialize", u"action_status": u"succeeded", u"task_uuid": logger.messages[0][u"task_uuid"], - u"task_level": u"/", })) From d4ab6ccd3a89b545d7af97fe9219b43a0eedb20d Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 26 Jan 2015 15:32:56 -0500 Subject: [PATCH 2/3] Use better eliot testing apis to make this test better. --- machinist/test/test_fsm.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/machinist/test/test_fsm.py b/machinist/test/test_fsm.py index 72d8966..a0b4e18 100644 --- a/machinist/test/test_fsm.py +++ b/machinist/test/test_fsm.py @@ -26,6 +26,7 @@ WrongState, stateful, + LOG_FSM_INITIALIZE, LOG_FSM_TRANSITION, ) @@ -861,15 +862,16 @@ def test_terminalLogging(self, logger): fsm.receive(Gravenstein()) - self.assertTrue( - issuperset(logger.messages[3], { - u"fsm_terminal_state": u"", - # 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"], - })) + (initialize,) = LoggedAction.of_type( + logger.messages, LOG_FSM_INITIALIZE + ) + assertContainsFields( + self, initialize.end_message, { + u"fsm_terminal_state": u"", + u"action_status": u"succeeded", + } + ) @validateLogging(None) def test_noRepeatedTerminalLogging(self, logger): From b33092962d1221e7c5d38808b4a572ddc052f94a Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 26 Jan 2015 15:35:06 -0500 Subject: [PATCH 3/3] Bump version for ``of_type``. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1b06d8a..9a06f80 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ # For the convenience of the travis configuration, make this information # particularly easy to find. See .travis.yml. -_MINIMUM_ELIOT_VERSION = "0.4.0" +_MINIMUM_ELIOT_VERSION = "0.5.0" if __name__ == '__main__': setup(