def test_update_load_job(self): """ 修改导入任务名称和备注 """ self.test_get_load_job() graph_id, job_id = ID.get_job_id() body = {"job_name": "load_01_update", "job_remarks": "修改任务名称和备注"} code, res = Load.update_load_job(body=body, graph_id=graph_id, job_id=job_id) self.assertEqual(code, 200, "响应状态码不正确") self.assertEqual(res['status'], 200, "修改导入任务名称和备注状态码不正确,修改导入任务名称和备注失败") self.assertEqual(res['data']['job_name'], body['job_name'], "修改导入任务名称有误") self.assertEqual(res['data']['job_remarks'], body['job_remarks'], "修改导入任务备注有误")
def test_upload_file(self): """ 上传文件 """ self.test_create_load_job() graph_id, job_id = ID.get_job_id() res = File.get_loadfile_token(graph_id=graph_id, job_id=job_id, param="names=movie.csv") token = res[1]["data"]["movie.csv"] param = "total=1&index=1&name=movie.csv&token=%s" % token files = {"file": open(current_path + "/../../../config/dataset/movie/movie.csv", 'rb')} code, res = File.upload_file(graph_id=graph_id, job_id=job_id, files=files, param=param) self.assertEqual(code, 200, "响应状态码不正确") self.assertEqual(res['status'], 200, "上传文件状态码不正确") self.assertEqual(res['data']['name'], "movie.csv", "上传文件有误") self.assertEqual(res['data']['status'], "SUCCESS", "上传文件失败")
def test_add_load_setting(self): """ 设置导入参数 """ self.test_add_edge_mapping() graph_id, job_id = ID.get_job_id() body = { "check_vertex": False, "insert_timeout": 60, "max_parse_errors": 500, "max_insert_errors": 500, "retry_times": 3, "retry_interval": 10 } # 点击下一步 Step.mapping_complete_next_step(graph_id=graph_id, job_id=job_id) code, res = Load.add_load_setting(body=body, graph_id=graph_id, job_id=job_id) self.assertEqual(code, 200, "响应状态码不正确") self.assertEqual(res['status'], 200, "设置导入参数状态码不正确")