@@ -746,23 +746,30 @@ async def test_graph_batch_operations(storage):
746
746
747
747
# 检查是否包含与机器学习、自然语言处理和计算机视觉的连接(忽略方向)
748
748
has_connection_with_node2 = any (
749
- (src == node2_id and tgt == node3_id ) or (src == node3_id and tgt == node2_id )
749
+ (src == node2_id and tgt == node3_id )
750
+ or (src == node3_id and tgt == node2_id )
750
751
for src , tgt in nodes_edges [node3_id ]
751
752
)
752
753
has_connection_with_node4 = any (
753
- (src == node3_id and tgt == node4_id ) or (src == node4_id and tgt == node3_id )
754
+ (src == node3_id and tgt == node4_id )
755
+ or (src == node4_id and tgt == node3_id )
754
756
for src , tgt in nodes_edges [node3_id ]
755
757
)
756
758
has_connection_with_node5 = any (
757
- (src == node3_id and tgt == node5_id ) or (src == node5_id and tgt == node3_id )
759
+ (src == node3_id and tgt == node5_id )
760
+ or (src == node5_id and tgt == node3_id )
758
761
for src , tgt in nodes_edges [node3_id ]
759
762
)
760
763
761
764
assert (
762
765
has_connection_with_node2
763
766
), f"节点 { node3_id } 的边列表中应包含与 { node2_id } 的连接"
764
- assert has_connection_with_node4 , f"节点 { node3_id } 的边列表中应包含与 { node4_id } 的连接"
765
- assert has_connection_with_node5 , f"节点 { node3_id } 的边列表中应包含与 { node5_id } 的连接"
767
+ assert (
768
+ has_connection_with_node4
769
+ ), f"节点 { node3_id } 的边列表中应包含与 { node4_id } 的连接"
770
+ assert (
771
+ has_connection_with_node5
772
+ ), f"节点 { node3_id } 的边列表中应包含与 { node5_id } 的连接"
766
773
767
774
print ("无向图特性验证成功:批量获取的节点边包含所有相关的边(无论方向)" )
768
775
0 commit comments