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


Python EUDATHandleClient.instantiate_for_read_and_search方法代码示例

本文整理汇总了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')
开发者ID:EUDAT-B2SAFE,项目名称:B2HANDLE,代码行数:9,代码来源:handleclient_unit_test.py

示例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)
开发者ID:merretbuurman,项目名称:B2HANDLE,代码行数:9,代码来源:handleclient_search_noaccess_test.py

示例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)
开发者ID:TonyWildish,项目名称:B2HANDLE,代码行数:16,代码来源:handleclient_searchaccess_test.py

示例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()
开发者ID:TonyWildish,项目名称:B2HANDLE,代码行数:20,代码来源:handleclient_searchaccess_test.py

示例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()
开发者ID:TonyWildish,项目名称:B2HANDLE,代码行数:21,代码来源:handleclient_searchaccess_test.py


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