(self)
| 128 | @mock.patch.object(PoolPublisher, "publish", mock.MagicMock()) |
| 129 | class 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 |
nothing calls this directly
no test coverage detected