当前位置: 首页>>代码示例>>Python>>正文


Python Node.hydrate方法代码示例

本文整理汇总了Python中py2neo.Node.hydrate方法的典型用法代码示例。如果您正苦于以下问题:Python Node.hydrate方法的具体用法?Python Node.hydrate怎么用?Python Node.hydrate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在py2neo.Node的用法示例。


在下文中一共展示了Node.hydrate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_full_node_hydrate

# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import hydrate [as 别名]
def test_full_node_hydrate():
    dehydrated = {
        "extensions": {
        },
        "paged_traverse": "http://localhost:7474/db/data/node/0/paged/traverse/{returnType}{?pageSize,leaseTime}",
        "labels": "http://localhost:7474/db/data/node/0/labels",
        "outgoing_relationships": "http://localhost:7474/db/data/node/0/relationships/out",
        "traverse": "http://localhost:7474/db/data/node/0/traverse/{returnType}",
        "all_typed_relationships": "http://localhost:7474/db/data/node/0/relationships/all/{-list|&|types}",
        "property": "http://localhost:7474/db/data/node/0/properties/{key}",
        "all_relationships": "http://localhost:7474/db/data/node/0/relationships/all",
        "self": "http://localhost:7474/db/data/node/0",
        "outgoing_typed_relationships": "http://localhost:7474/db/data/node/0/relationships/out/{-list|&|types}",
        "properties": "http://localhost:7474/db/data/node/0/properties",
        "incoming_relationships": "http://localhost:7474/db/data/node/0/relationships/in",
        "incoming_typed_relationships": "http://localhost:7474/db/data/node/0/relationships/in/{-list|&|types}",
        "create_relationship": "http://localhost:7474/db/data/node/0/relationships",
        "data": {
            "name": "Alice",
            "age": 33,
        },
    }
    hydrated = Node.hydrate(dehydrated)
    assert isinstance(hydrated, Node)
    assert hydrated.properties == dehydrated["data"]
    assert hydrated.bound
    assert hydrated.resource.uri == dehydrated["self"]
开发者ID:EricEllett,项目名称:py2neo,代码行数:29,代码来源:hydrate_test.py

示例2: test_minimal_node_hydrate

# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import hydrate [as 别名]
def test_minimal_node_hydrate():
    dehydrated = {
        "self": "http://localhost:7474/db/data/node/0",
    }
    hydrated = Node.hydrate(dehydrated)
    assert isinstance(hydrated, Node)
    assert hydrated.bound
    assert hydrated.resource.uri == dehydrated["self"]
开发者ID:EricEllett,项目名称:py2neo,代码行数:10,代码来源:hydrate_test.py

示例3: test_node_hydrate_with_properties

# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import hydrate [as 别名]
def test_node_hydrate_with_properties():
    dehydrated = {
        "self": "http://localhost:7474/db/data/node/0",
        "data": {
            "name": "Alice",
            "age": 33,
        },
    }
    hydrated = Node.hydrate(dehydrated)
    assert isinstance(hydrated, Node)
    assert hydrated.properties == dehydrated["data"]
    assert hydrated.bound
    assert hydrated.resource.uri == dehydrated["self"]
开发者ID:EricEllett,项目名称:py2neo,代码行数:15,代码来源:hydrate_test.py


注:本文中的py2neo.Node.hydrate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。