yangdx
commited on
Commit
·
7c275fd
1
Parent(s):
919fe2d
Fix linting
Browse files- tests/test_graph_storage.py +12 -5
tests/test_graph_storage.py
CHANGED
@@ -746,23 +746,30 @@ async def test_graph_batch_operations(storage):
|
|
746 |
|
747 |
# 检查是否包含与机器学习、自然语言处理和计算机视觉的连接(忽略方向)
|
748 |
has_connection_with_node2 = any(
|
749 |
-
(src == node2_id and tgt == node3_id)
|
|
|
750 |
for src, tgt in nodes_edges[node3_id]
|
751 |
)
|
752 |
has_connection_with_node4 = any(
|
753 |
-
(src == node3_id and tgt == node4_id)
|
|
|
754 |
for src, tgt in nodes_edges[node3_id]
|
755 |
)
|
756 |
has_connection_with_node5 = any(
|
757 |
-
(src == node3_id and tgt == node5_id)
|
|
|
758 |
for src, tgt in nodes_edges[node3_id]
|
759 |
)
|
760 |
|
761 |
assert (
|
762 |
has_connection_with_node2
|
763 |
), f"节点 {node3_id} 的边列表中应包含与 {node2_id} 的连接"
|
764 |
-
assert
|
765 |
-
|
|
|
|
|
|
|
|
|
766 |
|
767 |
print("无向图特性验证成功:批量获取的节点边包含所有相关的边(无论方向)")
|
768 |
|
|
|
746 |
|
747 |
# 检查是否包含与机器学习、自然语言处理和计算机视觉的连接(忽略方向)
|
748 |
has_connection_with_node2 = any(
|
749 |
+
(src == node2_id and tgt == node3_id)
|
750 |
+
or (src == node3_id and tgt == node2_id)
|
751 |
for src, tgt in nodes_edges[node3_id]
|
752 |
)
|
753 |
has_connection_with_node4 = any(
|
754 |
+
(src == node3_id and tgt == node4_id)
|
755 |
+
or (src == node4_id and tgt == node3_id)
|
756 |
for src, tgt in nodes_edges[node3_id]
|
757 |
)
|
758 |
has_connection_with_node5 = any(
|
759 |
+
(src == node3_id and tgt == node5_id)
|
760 |
+
or (src == node5_id and tgt == node3_id)
|
761 |
for src, tgt in nodes_edges[node3_id]
|
762 |
)
|
763 |
|
764 |
assert (
|
765 |
has_connection_with_node2
|
766 |
), f"节点 {node3_id} 的边列表中应包含与 {node2_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} 的连接"
|
773 |
|
774 |
print("无向图特性验证成功:批量获取的节点边包含所有相关的边(无论方向)")
|
775 |
|