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


Python Connection.load_service_document方法代码示例

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


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

示例1: test_03_init_then_load_from_string_t_history

# 需要导入模块: from sword2 import Connection [as 别名]
# 或者: from sword2.Connection import load_service_document [as 别名]
 def test_03_init_then_load_from_string_t_history(self):
     conn = Connection("http://example.org/service-doc")
     assert conn.sd_iri == "http://example.org/service-doc"
     assert conn.sd == None
     conn.load_service_document(long_service_doc)
     # Should have made a two client 'transactions', the init and subsequent XML load
     assert len(conn.history) == 2
     assert conn.history[0]['type'] == "init"
     assert conn.history[1]['type'] == "SD Parse"
开发者ID:Hwesta,项目名称:python-client-sword2,代码行数:11,代码来源:test_connection.py

示例2: test_02_init_then_load_from_string

# 需要导入模块: from sword2 import Connection [as 别名]
# 或者: from sword2.Connection import load_service_document [as 别名]
 def test_02_init_then_load_from_string(self):
     conn = Connection("http://example.org/service-doc")
     assert conn.sd_iri == "http://example.org/service-doc"
     assert conn.sd == None
     conn.load_service_document(long_service_doc)
     assert conn.sd != None
     assert len(conn.sd.workspaces) == 2
     assert len(conn.workspaces) == 2
     assert conn.sd.workspaces[0][0] == "Main Site"
     assert conn.sd.workspaces[1][0] == "Sub-site"
     assert len(conn.sd.workspaces[1][1]) == 2
开发者ID:Hwesta,项目名称:python-client-sword2,代码行数:13,代码来源:test_connection.py


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