本文整理汇总了Python中py2neo.Node.join方法的典型用法代码示例。如果您正苦于以下问题:Python Node.join方法的具体用法?Python Node.join怎么用?Python Node.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py2neo.Node
的用法示例。
在下文中一共展示了Node.join方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cannot_join_one_of_other_type
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_cannot_join_one_of_other_type():
foo = "foo"
with pytest.raises(TypeError):
Node.join(alice, foo)
示例2: test_cannot_join_node_and_pointer
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_cannot_join_node_and_pointer():
with pytest.raises(JoinError):
Node.join(alice, pointer_2)
示例3: test_cannot_join_other_types
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_cannot_join_other_types():
foo = "foo"
with pytest.raises(TypeError):
Node.join(foo, foo)
示例4: test_can_join_same_pointers
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_can_join_same_pointers():
assert Node.join(pointer_1, pointer_1) is pointer_1
示例5: test_cannot_join_different_pointers
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_cannot_join_different_pointers():
with pytest.raises(JoinError):
Node.join(pointer_1, pointer_2)
示例6: test_can_join_none_and_pointer
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_can_join_none_and_pointer():
assert Node.join(None, pointer_1) is pointer_1
示例7: test_can_join_pointer_and_node
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_can_join_pointer_and_node():
assert Node.join(pointer_1, None) is pointer_1
示例8: test_can_join_same_nodes
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_can_join_same_nodes():
assert Node.join(alice, alice) is alice
示例9: test_cannot_join_different_nodes
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_cannot_join_different_nodes():
with pytest.raises(JoinError):
Node.join(alice, bob)
示例10: test_can_join_node_and_none
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_can_join_node_and_none():
assert Node.join(alice, None) is alice
示例11: test_can_join_none_and_node
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_can_join_none_and_node():
assert Node.join(None, alice) is alice
示例12: test_can_join_none_and_none
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_can_join_none_and_none():
assert Node.join(None, None) is None
示例13: test_can_join_equal_pointers
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_can_join_equal_pointers():
assert Node.join(pointer_1, NodePointer(pointer_1.address)) == pointer_1
示例14: test_can_join_similar_bound_nodes
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import join [as 别名]
def test_can_join_similar_bound_nodes():
alice.bind("http://localhost:7474/db/data/node/1")
Node.cache.clear()
alice_2 = Node(name="Alice")
alice_2.bind(alice.uri)
assert Node.join(alice, alice_2) == alice