def test_get_undo_recipe(self): # Test Action action_steps = SetState.get_undo_recipe(self.action_spec) # Test Assertions # expecting for one step: [update_vertex] self.assertEqual(1, len(action_steps)) self.assertEqual(UPDATE_VERTEX, action_steps[0].type) update_vertex_step_params = action_steps[0].params self.assertEqual(2, len(update_vertex_step_params)) vitrage_state = update_vertex_step_params[VProps.VITRAGE_STATE] self.assertIsNone(vitrage_state) vitrage_id = update_vertex_step_params[VProps.VITRAGE_ID] self.assertEqual(self.target_vertex_id, vitrage_id)
def test_get_undo_recipe(self): # Test Action action_steps = SetState.get_undo_recipe(self.action_spec) # Test Assertions # expecting for one step: [update_vertex] self.assertEqual(1, len(action_steps)) self.assertEqual(UPDATE_VERTEX, action_steps[0].type) update_vertex_step_params = action_steps[0].params self.assertEqual(_SET_STATES_PARAM_LEN, len(update_vertex_step_params)) vitrage_state = update_vertex_step_params[VProps.VITRAGE_STATE] self.assertIsNone(vitrage_state) vitrage_id = update_vertex_step_params[VProps.VITRAGE_ID] self.assertEqual(self.target_vertex.vertex_id, vitrage_id)
def test_get_do_recipe(self): # Test Action action_steps = SetState.get_do_recipe(self.action_spec) # Test Assertions # expecting for one step: [update_vertex] self.assertThat(action_steps, matchers.HasLength(1)) self.assertEqual(UPDATE_VERTEX, action_steps[0].type) update_vertex_step_params = action_steps[0].params self.assertThat(update_vertex_step_params, matchers.HasLength(_SET_STATES_PARAM_LEN)) vitrage_state = update_vertex_step_params[VProps.VITRAGE_STATE] self.assertEqual(self.props[TFields.STATE], vitrage_state) vitrage_id = update_vertex_step_params[VProps.VITRAGE_ID] self.assertEqual(self.target_vertex.vertex_id, vitrage_id)