本文整理汇总了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, '', [])
示例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"'), [])
示例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: .*')