please use  mock patch object like  mock patch object vmops vmwarevmops sized image exists return value false  mock patch object vmops vmwarevmops extend virtual disk mock patch object vm util copy virtual disk  here and below 