本文整理汇总了Python中nailgun.task.task.CheckBeforeDeploymentTask._check_volumes方法的典型用法代码示例。如果您正苦于以下问题:Python CheckBeforeDeploymentTask._check_volumes方法的具体用法?Python CheckBeforeDeploymentTask._check_volumes怎么用?Python CheckBeforeDeploymentTask._check_volumes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nailgun.task.task.CheckBeforeDeploymentTask
的用法示例。
在下文中一共展示了CheckBeforeDeploymentTask._check_volumes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_check_volumes_and_disks_do_not_run_if_node_ready
# 需要导入模块: from nailgun.task.task import CheckBeforeDeploymentTask [as 别名]
# 或者: from nailgun.task.task.CheckBeforeDeploymentTask import _check_volumes [as 别名]
def test_check_volumes_and_disks_do_not_run_if_node_ready(self):
self.set_node_status('ready')
with patch.object(
VolumeManager,
'check_disk_space_for_deployment') as check_mock:
CheckBeforeDeploymentTask._check_disks(self.task)
self.assertFalse(check_mock.called)
with patch.object(
VolumeManager,
'check_volume_sizes_for_deployment') as check_mock:
CheckBeforeDeploymentTask._check_volumes(self.task)
self.assertFalse(check_mock.called)
示例2: test_check_volumes_and_disks_run_if_node_not_ready
# 需要导入模块: from nailgun.task.task import CheckBeforeDeploymentTask [as 别名]
# 或者: from nailgun.task.task.CheckBeforeDeploymentTask import _check_volumes [as 别名]
def test_check_volumes_and_disks_run_if_node_not_ready(self):
self.set_node_status('discover')
with patch.object(
VolumeManager,
'check_disk_space_for_deployment') as check_mock:
CheckBeforeDeploymentTask._check_disks(self.task)
self.assertEqual(check_mock.call_count, 1)
with patch.object(
VolumeManager,
'check_volume_sizes_for_deployment') as check_mock:
CheckBeforeDeploymentTask._check_volumes(self.task)
self.assertEqual(check_mock.call_count, 1)