def test_execution_list(self): created0 = db_api.execution_create(EXECUTIONS[0]['workbook_name'], EXECUTIONS[0]) created1 = db_api.execution_create(EXECUTIONS[1]['workbook_name'], EXECUTIONS[1]) fetched = db_api.executions_get_all( workbook_name=EXECUTIONS[0]['workbook_name']) self.assertEqual(2, len(fetched)) self.assertDictEqual(created0, fetched[0]) self.assertDictEqual(created1, fetched[1])
def test_execution_create_and_get(self): created = db_api.execution_create(EXECUTIONS[0]['workbook_name'], EXECUTIONS[0]) self.assertIsInstance(created, dict) fetched = db_api.execution_get(created['id']) self.assertIsInstance(fetched, dict) self.assertDictEqual(created, fetched)
def test_execution_create_and_get(self): created = db_api.execution_create(EXECUTIONS[0]['workbook_name'], EXECUTIONS[0]) self.assertIsInstance(created, dict) fetched = db_api.execution_get(EXECUTIONS[0]['workbook_name'], created['id']) self.assertIsInstance(fetched, dict) self.assertDictEqual(created, fetched)
def test_execution_update(self): created = db_api.execution_create(EXECUTIONS[0]['workbook_name'], EXECUTIONS[0]) self.assertIsInstance(created, dict) updated = db_api.execution_update(created['id'], {'task': 'task10'}) self.assertIsInstance(updated, dict) self.assertEqual('task10', updated['task']) fetched = db_api.execution_get(created['id']) self.assertDictEqual(updated, fetched)
def test_execution_update(self): created = db_api.execution_create(EXECUTIONS[0]['workbook_name'], EXECUTIONS[0]) self.assertIsInstance(created, dict) updated = db_api.execution_update(EXECUTIONS[0]['workbook_name'], created['id'], {'task': 'task10'}) self.assertIsInstance(updated, dict) self.assertEqual('task10', updated['task']) fetched = db_api.execution_get(EXECUTIONS[0]['workbook_name'], created['id']) self.assertDictEqual(updated, fetched)
def test_execution_delete(self): created = db_api.execution_create(EXECUTIONS[0]['workbook_name'], EXECUTIONS[0]) self.assertIsInstance(created, dict) fetched = db_api.execution_get(created['id']) self.assertIsInstance(fetched, dict) self.assertDictEqual(created, fetched) db_api.execution_delete(created['id']) self.assertRaises(exc.NotFoundException, db_api.execution_get, created['id'])