'Test image disk is cached when use_linked_clone is True.'

@mock.patch.object(nova.virt.vmwareapi.images.VMwareImage, 'from_image')
def test_cache_dir_disk_created(self, mock_from_image):

    self.flags(use_linked_clone=True, group='vmware')
    img_props = images.VMwareImage(image_id=self.fake_image_uuid, file_size=(1 * units.Ki), disk_type=constants.DISK_TYPE_SPARSE)
    mock_from_image.return_value = img_props
    self._create_vm()
    path = ds_obj.DatastorePath(self.ds, 'vmware_base', self.fake_image_uuid, ('%s.vmdk' % self.fake_image_uuid))
    root = ds_obj.DatastorePath(self.ds, 'vmware_base', self.fake_image_uuid, ('%s.80.vmdk' % self.fake_image_uuid))
    vmwareapi_fake.assertPathExists(self, str(path))
    vmwareapi_fake.assertPathExists(self, str(root))
