MCPcopy Create free account
hub / github.com/StackStorm/st2 / setUp

Method setUp

st2common/tests/unit/test_db_execution.py:130–149  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

128@mock.patch.object(PoolPublisher, "publish", mock.MagicMock())
129class ActionExecutionModelTest(DbTestCase):
130 def setUp(self):
131
132 self.executions = {}
133
134 for name, execution in ACTIONEXECUTIONS.items():
135
136 created = ActionExecutionDB()
137 created.action = execution["action"]
138 created.status = execution["status"]
139 created.runner = execution["runner"]
140 created.liveaction = execution["liveaction"]
141 created.result = execution["result"]
142
143 saved = ActionExecutionModelTest._save_execution(created)
144 retrieved = ActionExecution.get_by_id(saved.id)
145 self.assertEqual(
146 saved.action, retrieved.action, "Same action was not returned."
147 )
148
149 self.executions[name] = retrieved
150
151 def tearDown(self):
152

Callers

nothing calls this directly

Calls 3

ActionExecutionDBClass · 0.90
_save_executionMethod · 0.80
get_by_idMethod · 0.45

Tested by

no test coverage detected