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


Python NailgunReceiver.check_repositories_resp方法代码示例

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


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

示例1: test_check_repositories_resp_success

# 需要导入模块: from nailgun.rpc.receiver import NailgunReceiver [as 别名]
# 或者: from nailgun.rpc.receiver.NailgunReceiver import check_repositories_resp [as 别名]
    def test_check_repositories_resp_success(self, update_verify_networks):
        repo_check_message = {
            "status": "ready",
            "progress": 100,
            "task_uuid": self.task.uuid,
            "nodes": [{
                "status": 0,
                "err": "",
                "out": "",
                "uid": "1"}]}
        NailgunReceiver.check_repositories_resp(**repo_check_message)

        update_verify_networks.assert_called_with(
            self.task, 'ready', 100, '', [])
开发者ID:mba811,项目名称:fuel-web,代码行数:16,代码来源:test_receiver.py

示例2: test_check_repositories_resp_error

# 需要导入模块: from nailgun.rpc.receiver import NailgunReceiver [as 别名]
# 或者: from nailgun.rpc.receiver.NailgunReceiver import check_repositories_resp [as 别名]
    def test_check_repositories_resp_error(self, update_verify_networks):
        urls = ['url1', 'url2']
        repo_check_message = {
            "status": "ready",
            "progress": 100,
            "task_uuid": self.task.uuid,
            "nodes": [{
                "status": 1,
                "out": {"failed_urls": urls},
                "err": "",
                "uid": "1"}]}
        NailgunReceiver.check_repositories_resp(**repo_check_message)

        update_verify_networks.assert_called_with(
            self.task, 'error', 100,
            ('These nodes: "1" failed to '
             'connect to some of these repositories: "url1", "url2"'), [])
开发者ID:kansuke4649,项目名称:fuel-web,代码行数:19,代码来源:test_receiver.py

示例3: test_check_repositories_resp_error

# 需要导入模块: from nailgun.rpc.receiver import NailgunReceiver [as 别名]
# 或者: from nailgun.rpc.receiver.NailgunReceiver import check_repositories_resp [as 别名]
    def test_check_repositories_resp_error(self, update_verify_networks):
        urls = ['url2', 'url1', 'url3', 'url1']
        repo_check_message = {
            "status": "ready",
            "progress": 100,
            "task_uuid": self.task.uuid,
            "nodes": [{
                "status": 1,
                "out": {"failed_urls": urls},
                "err": "",
                "uid": "1"}]}
        NailgunReceiver.check_repositories_resp(**repo_check_message)

        update_verify_networks.assert_called_with(
            self.task, 'error', 100, ANY, [])
        actual_msg = update_verify_networks.call_args[0][3]
        expected_urls_set = set(urls)
        actual_urls = actual_msg.replace('"', '').replace(',', '').\
            split()[-len(expected_urls_set):]
        self.assertItemsEqual(expected_urls_set, actual_urls)
        self.assertRegexpMatches(
            actual_msg,
            r'These nodes: "1" failed to '
            'connect to some of these repositories: .*')
开发者ID:mba811,项目名称:fuel-web,代码行数:26,代码来源:test_receiver.py


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