def test_done_query_job(self): self.tps.clean_up() self.tps.add_jdoe_in_users() job_manager = JobManager(self.settings, self.request.session) job_manager.save_query_job('graph_string', '_s3_7B_s3_27variate_s3_27_s3_3A_s3_20_s3_5B_s3_27_s3_3Fvariate_s3_27_s3_5D_s3_7D', 1) job_manager.done_query_job(1, 15, 'data_string', 'file_string') assert self.tps.test_row_presence('query', 'user_id, state, data, file, preview, graph, variates, nrows, error', (1, 'done', '_s3_22data_string_s3_22', 'file_string', None, 'graph_string', '_s3_7B_s3_27variate_s3_27_s3_3A_s3_20_s3_5B_s3_27_s3_3Fvariate_s3_27_s3_5D_s3_7D', 15, None))
def test_list_query_jobs(self): self.tps.clean_up() self.tps.add_jdoe_in_users() job_manager = JobManager(self.settings, self.request.session) job_manager.save_query_job('graph_string', '_s3_7B_s3_27variate_s3_27_s3_3A_s3_20_s3_5B_s3_27_s3_3Fvariate_s3_27_s3_5D_s3_7D', 1) job_manager.save_query_job('graph_string2', '_s3_7B_s3_27variate_s3_27_s3_3A_s3_20_s3_5B_s3_27_s3_3Fvariate_s3_27_s3_5D_s3_7D', 1) job_manager.done_query_job(2, 15, 'data_string2', 'file_string2') result = job_manager.list_query_jobs(1) assert len(result) == 2
def test_done_query_job(self): self.tps.clean_up() self.tps.add_jdoe_in_users() job_manager = JobManager(self.settings, self.request.session) job_manager.save_query_job( 'graph_string', '_s3_7B_s3_27variate_s3_27_s3_3A_s3_20_s3_5B_s3_27_s3_3Fvariate_s3_27_s3_5D_s3_7D' ) job_manager.done_query_job(1, 15, 'data_string', 'file_string') assert self.tps.test_row_presence( 'query', 'user_id, state, data, file, preview, graph, variates, nrows, error', (1, 'done', '_s3_22data_string_s3_22', 'file_string', None, 'graph_string', '_s3_7B_s3_27variate_s3_27_s3_3A_s3_20_s3_5B_s3_27_s3_3Fvariate_s3_27_s3_5D_s3_7D', 15, None))
def test_list_query_jobs(self): self.tps.clean_up() self.tps.add_jdoe_in_users() job_manager = JobManager(self.settings, self.request.session) job_manager.save_query_job( 'graph_string', '_s3_7B_s3_27variate_s3_27_s3_3A_s3_20_s3_5B_s3_27_s3_3Fvariate_s3_27_s3_5D_s3_7D' ) job_manager.save_query_job( 'graph_string2', '_s3_7B_s3_27variate_s3_27_s3_3A_s3_20_s3_5B_s3_27_s3_3Fvariate_s3_27_s3_5D_s3_7D' ) job_manager.done_query_job(2, 15, 'data_string2', 'file_string2') result = job_manager.list_query_jobs() assert len(result) == 2