Ejemplo n.º 1
0
 def test_delete_load_job(self):
     """
     删除任务
     """
     self.test_stop_load()
     graph_id, job_id, file_id, task_id = ID.get_task_id()
     code, res = Load.delete_load_job(graph_id=graph_id, job_id=job_id)
     self.assertEqual(code, 200, "响应状态码不正确")
     self.assertEqual(res['status'], 200, "删除任务状态码不正确,删除任务失败")
Ejemplo n.º 2
0
 def test_get_load_task(self):
     """
     查询导入任务
     """
     self.test_stop_load()
     graph_id, job_id, file_id, task_id = ID.get_task_id()
     param = "task_id=%d" % task_id
     code, res = Load.query_load_task(graph_id=graph_id, job_id=job_id, param=param)
     self.assertEqual(code, 200, "响应状态码不正确")
     self.assertEqual(res['status'], 200, "查询导入状态码不正确,查询导入任务失败")
Ejemplo n.º 3
0
 def test_retry_load(self):
     """
     点击重试导入
     """
     self.test_stop_load()
     graph_id, job_id, file_id, task_id = ID.get_task_id()
     param = "task_id=%d" % task_id
     code, res = Load.retry_load(graph_id=graph_id, job_id=job_id, param=param)
     self.assertEqual(code, 200, "响应状态码不正确")
     self.assertEqual(res['status'], 200, "重试导入状态码不正确,重试导入失败")
     self.assertEqual(res['data']['status'], 'RUNNING', "重试导入错误")
Ejemplo n.º 4
0
 def test_stop_load(self):
     """
     点击停止导入
     """
     self.test_resume_load()
     graph_id, job_id, file_id, task_id = ID.get_task_id()
     param = "task_id=%d" % task_id
     code, res = Load.stop_load(graph_id=graph_id, job_id=job_id, param=param)
     self.assertEqual(code, 200, "响应状态码不正确")
     self.assertEqual(res['status'], 200, "停止导入状态码不正确,停止导入失败")
     self.assertEqual(res['data']['status'], 'STOPPED', "停止导入错误")
Ejemplo n.º 5
0
 def test_pause_load(self):
     """
     点击暂停导入
     """
     self.test_start_load()
     graph_id, job_id, file_id, task_id = ID.get_task_id()
     param = "task_id=%d" % task_id
     code, res = Load.pause_load(graph_id=graph_id, job_id=job_id, param=param)
     self.assertEqual(code, 200, "响应状态码不正确")
     self.assertEqual(res['status'], 200, "暂停导入状态码不正确,暂停导入失败")
     self.assertEqual(res['data']['status'], 'PAUSED', "暂停导入错误")
Ejemplo n.º 6
0
 def test_resume_load(self):
     """
     点击继续导入
     """
     self.test_pause_load()
     graph_id, job_id, file_id, task_id = ID.get_task_id()
     param = "task_id=%d" % task_id
     time.sleep(1)
     code, res = Load.resume_load(graph_id=graph_id, job_id=job_id, param=param)
     self.assertEqual(code, 200, "响应状态码不正确")
     self.assertEqual(res['status'], 200, "继续导入状态码不正确,继续导入失败")
     self.assertEqual(res['data']['status'], 'RUNNING', "继续导入错误")