test_deploy.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ironic-staging-drivers 作者: openstack 项目源码 文件源码
def test_deploy_no_callback(self, power_mock, get_ip_mock):
        self.config(group='ansible', use_ramdisk_callback=False)
        with mock.patch.multiple(self.driver,
                                 _ansible_deploy=mock.DEFAULT,
                                 reboot_to_instance=mock.DEFAULT) as moks:
            with task_manager.acquire(
                    self.context, self.node['uuid'], shared=False) as task:
                driver_return = self.driver.deploy(task)
                self.assertEqual(driver_return, states.DEPLOYDONE)
                power_mock.assert_called_once_with(task, states.REBOOT)
                get_ip_mock.assert_called_once_with(task)
                moks['_ansible_deploy'].assert_called_once_with(task,
                                                                '127.0.0.1')
                moks['reboot_to_instance'].assert_called_once_with(task)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号