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)
评论列表
文章目录