test_openstack_utils.py 文件源码

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

项目:functest 作者: opnfv 项目源码 文件源码
def test_create_glance_image_default(self, mock_logger_info):
        with mock.patch('functest.utils.openstack_utils.'
                        'os.path.isfile',
                        return_value=True), \
            mock.patch('functest.utils.openstack_utils.get_image_id',
                       return_value=''), \
            mock.patch('six.moves.builtins.open',
                       mock.mock_open(read_data='1')) as m:
                self.assertEqual(openstack_utils.
                                 create_glance_image(self.glance_client,
                                                     'test_image',
                                                     'file_path'),
                                 'image_id')
                m.assert_called_once_with('file_path')
                self.assertTrue(mock_logger_info.called)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号