def test_update_vertex_mapping(self): """ 更新顶点映射 """ self.test_add_vertex_mapping() graph_id, job_id, file_id, vertex_id = ID.get_vertexMapping_id() vertex_movie = { "label": "电影", "id_fields": ["名称"], "field_mapping": [{ "column_name": "发行时间", "mapped_name": "发行时间_更新" }, { "column_name": "类型", "mapped_name": "类型" }], "value_mapping": [], "null_values": { "checked": ["NULL", "null"], "customized": [] } } code, res = Mapping.update_vertex_mapping(body=vertex_movie, graph_id=graph_id, job_id=job_id, file_id=file_id, vertex_id=vertex_id) self.assertEqual(code, 200, "响应状态码不正确") self.assertEqual(res['status'], 200, "修改顶点映射状态码不正确") self.assertEqual(res['data']['vertex_mappings'][1]['field_mapping'][0]['mapped_name'], vertex_movie['field_mapping'][0]['mapped_name'], "顶点映射修改有误")
def test_delete_vertex_mapping(self): """ 删除一个顶点映射 """ self.test_add_vertex_mapping() graph_id, job_id, file_id, vertex_id = ID.get_vertexMapping_id() code, res = Mapping.delete_vertex_mapping(graph_id=graph_id, job_id=job_id, file_id=file_id, vertex_id=vertex_id) self.assertEqual(code, 200, "响应状态码不正确") self.assertEqual(res['status'], 200, "删除顶点映射状态码不正确")