本文整理汇总了Python中b2handle.handleclient.EUDATHandleClient.instantiate_for_read_and_search方法的典型用法代码示例。如果您正苦于以下问题:Python EUDATHandleClient.instantiate_for_read_and_search方法的具体用法?Python EUDATHandleClient.instantiate_for_read_and_search怎么用?Python EUDATHandleClient.instantiate_for_read_and_search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类b2handle.handleclient.EUDATHandleClient
的用法示例。
在下文中一共展示了EUDATHandleClient.instantiate_for_read_and_search方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_instantiate_for_read_an_search
# 需要导入模块: from b2handle.handleclient import EUDATHandleClient [as 别名]
# 或者: from b2handle.handleclient.EUDATHandleClient import instantiate_for_read_and_search [as 别名]
def test_instantiate_for_read_an_search(self):
"""Testing if instantiating with default handle server works. """
# Try to create client instance for search without a search URL:
with self.assertRaises(TypeError):
inst = EUDATHandleClient.instantiate_for_read_and_search(
None, 'johndoe', 'passywordy')
示例2: test_instantiate_wrong_search_url
# 需要导入模块: from b2handle.handleclient import EUDATHandleClient [as 别名]
# 或者: from b2handle.handleclient.EUDATHandleClient import instantiate_for_read_and_search [as 别名]
def test_instantiate_wrong_search_url(self):
inst = EUDATHandleClient.instantiate_for_read_and_search(
"someurl", "someuser", "somepassword", reverselookup_baseuri="http://something_random_foo_bar"
)
self.assertIsInstance(inst, EUDATHandleClient)
示例3: setUp
# 需要导入模块: from b2handle.handleclient import EUDATHandleClient [as 别名]
# 或者: from b2handle.handleclient.EUDATHandleClient import instantiate_for_read_and_search [as 别名]
def setUp(self):
'''Providing a client instance that has read and search access
to the servers specified in the test resources JSON file.
'''
REQUESTLOGGER.info("\n"+60*"*"+"\nsetUp of EUDATHandleClientSearchTestCase")
self.inst = EUDATHandleClient.instantiate_for_read_and_search(
self.url,
self.searchuser,
self.searchpassword,
reverselookup_baseuri=self.searchurl,
reverselookup_url_extension=self.searchpath,
HTTPS_verify=self.https_verify)
示例4: test_search_handle_wrong_url_test
# 需要导入模块: from b2handle.handleclient import EUDATHandleClient [as 别名]
# 或者: from b2handle.handleclient.EUDATHandleClient import instantiate_for_read_and_search [as 别名]
def test_search_handle_wrong_url_test(self):
"""Test exception when wrong search servlet URL is given."""
log_new_test_case("test_search_handle_wrong_url_test")
# Make new client instance with existing but wrong url for searching:
inst = EUDATHandleClient.instantiate_for_read_and_search(
self.url,
self.searchuser,
self.searchpassword,
reverselookup_baseuri=self.searchurl_wrong,
reverselookup_url_extension=self.searchpath,
HTTPS_verify=self.https_verify)
# Run code to be tested + check exception:
log_start_test_code()
with self.assertRaises(ReverseLookupException):
inst.search_handle(URL='*')
log_end_test_code()
示例5: test_search_handle_hs_url_test
# 需要导入模块: from b2handle.handleclient import EUDATHandleClient [as 别名]
# 或者: from b2handle.handleclient.EUDATHandleClient import instantiate_for_read_and_search [as 别名]
def test_search_handle_hs_url_test(self):
"""Test exception when wrong search servlet URL (Handle Server REST API URL) is given."""
log_new_test_case("test_search_handle_hs_url_test")
# Make new instance with handle server url as search url:
self.inst = EUDATHandleClient.instantiate_for_read_and_search(
self.url,
self.searchuser,
self.searchpassword,
reverselookup_baseuri=self.url,
reverselookup_url_extension=self.path_to_api,
HTTPS_verify=self.https_verify)
# Run code to be tested + check exception:
log_start_test_code()
with self.assertRaises(ReverseLookupException):
self.inst.search_handle(URL='*')
# TODO specify exception
log_end_test_code()