def before(self): self.resource_result = TestResultResource( database=self.database, database_options=self.database_options) self.api.add_route('/result/', self.resource_result) self.api.add_route('/result/{result_id}/', self.resource_result) session = utils.create_db_session( database=self.database, database_options=self.database_options) task, created = Task.create_unique_task( session, "sampletask", "sampletask") result, created = Result.create_unique_result( session, task.id, 'command', 1) utils.close_db_session(session)
def before(self): # configure the api routes self.resource_task = TestTaskResource( database=self.database, database_options=self.database_options) self.api.add_route('/task/', self.resource_task) self.api.add_route('/task/{task_id}/', self.resource_task) # create any required database objects session = utils.create_db_session( database=self.database, database_options=self.database_options) task, created = Task.create_unique_task( session, "sampletask", "sampletask") utils.close_db_session(session)