# Path: oslo_vmware/exceptions.py
# LOG = logging.getLogger(__name__)
# ALREADY_EXISTS = 'AlreadyExists'
# CANNOT_DELETE_FILE = 'CannotDeleteFile'
# DUPLICATE_NAME = 'DuplicateName'
# FILE_ALREADY_EXISTS = 'FileAlreadyExists'
# FILE_FAULT = 'FileFault'
# FILE_LOCKED = 'FileLocked'
# FILE_NOT_FOUND = 'FileNotFound'
# INVALID_POWER_STATE = 'InvalidPowerState'
# INVALID_PROPERTY = 'InvalidProperty'
# NO_DISK_SPACE = 'NoDiskSpace'
# NO_PERMISSION = 'NoPermission'
# NOT_AUTHENTICATED = 'NotAuthenticated'
# SECURITY_ERROR = "SecurityError"
# MANAGED_OBJECT_NOT_FOUND = 'ManagedObjectNotFound'
# TASK_IN_PROGRESS = 'TaskInProgress'
# TOOLS_UNAVAILABLE = 'ToolsUnavailable'
# class VMwareDriverException(Exception):
# class VimException(VMwareDriverException):
# class VimSessionOverLoadException(VMwareDriverException):
# class VimConnectionException(VMwareDriverException):
# class VimAttributeException(VMwareDriverException):
# class VimFaultException(VimException):
# class ImageTransferException(VMwareDriverException):
# class VMwareDriverConfigurationException(VMwareDriverException):
# class UseLinkedCloneConfigurationFault(VMwareDriverConfigurationException):
# class MissingParameter(VMwareDriverException):
# class AlreadyExistsException(VimException):
# class CannotDeleteFileException(VimException):
# class FileAlreadyExistsException(VimException):
# class FileFaultException(VimException):
# class FileLockedException(VimException):
# class FileNotFoundException(VimException):
# class InvalidPowerStateException(VimException):
# class InvalidPropertyException(VimException):
# class NoPermissionException(VimException):
# class NotAuthenticatedException(VimException):
# class TaskInProgress(VimException):
# class DuplicateName(VimException):
# class NoDiskSpaceException(VimException):
# class ToolsUnavailableException(VimException):
# class ManagedObjectNotFoundException(VimException):
#     def __str__(self):
#     def __init__(self, message=None, details=None, **kwargs):
#     def msg(self):
#     def description(self):
#     def __init__(self, message=None, cause=None, details=None, **kwargs):
#     def __init__(self, message, cause=None):
#     def __init__(self, message, cause=None):
#     def __init__(self, message, cause=None):
#     def __init__(self, fault_list, message, cause=None, details=None):
#     def description(self):
#     def __init__(self, message, cause=None):
# def _print_deprecation_warning(clazz):
#     def __init__(self, message=None, details=None, **kwargs):
#     def __init__(self, message=None, details=None, **kwargs):
# def get_fault_class(name):
# def translate_fault(localized_method_fault, excep_msg=None):
# def register_fault_class(name, exception):
# 
# Path: oslo_vmware/vim.py
# class Vim(service.Service):
#     def __init__(self, protocol='https', host='localhost', port=None,
#                  wsdl_url=None, cacert=None, insecure=True, pool_maxsize=10,
#                  connection_timeout=None, op_id_prefix='oslo.vmware'):
#     def retrieve_service_content(self):
#     def __repr__(self):
#     def __str__(self):


import copy
import suds
from unittest import mock
from oslo_i18n import fixture as i18n_fixture
from oslo_vmware import exceptions
from oslo_vmware.tests import base
from oslo_vmware import vim
    def test_configure_with_wsdl_url_override(self):
        vim_obj = vim.Vim('https', 'www.example.com',
                          wsdl_url='https://test.com/sdk/vimService.wsdl')
        self.assertEqual('https://test.com/sdk/vimService.wsdl',
                         vim_obj.wsdl_url)
        self.assertEqual('https://www.example.com/sdk', vim_obj.soap_url)


class VMwareSudsTest(base.TestCase):
    def setUp(self):
        super(VMwareSudsTest, self).setUp()

        def new_client_init(self, url, **kwargs):
            return

        mock.patch.object(suds.client.Client,
                          '__init__', new=new_client_init).start()
        self.addCleanup(mock.patch.stopall)
        self.vim = self._vim_create()

    def _mock_getattr(self, attr_name):
        class fake_service_content(object):
            def __init__(self):
                self.ServiceContent = {}
                self.ServiceContent.fake = 'fake'

        self.assertEqual("RetrieveServiceContent", attr_name)
        return lambda obj, **kwargs: fake_service_content()

    def _vim_create(self):

# Path: oslo_vmware/exceptions.py
# LOG = logging.getLogger(__name__)
# ALREADY_EXISTS = 'AlreadyExists'
# CANNOT_DELETE_FILE = 'CannotDeleteFile'
# DUPLICATE_NAME = 'DuplicateName'
# FILE_ALREADY_EXISTS = 'FileAlreadyExists'
# FILE_FAULT = 'FileFault'
# FILE_LOCKED = 'FileLocked'
# FILE_NOT_FOUND = 'FileNotFound'
# INVALID_POWER_STATE = 'InvalidPowerState'
# INVALID_PROPERTY = 'InvalidProperty'
# NO_DISK_SPACE = 'NoDiskSpace'
# NO_PERMISSION = 'NoPermission'
# NOT_AUTHENTICATED = 'NotAuthenticated'
# SECURITY_ERROR = "SecurityError"
# MANAGED_OBJECT_NOT_FOUND = 'ManagedObjectNotFound'
# TASK_IN_PROGRESS = 'TaskInProgress'
# TOOLS_UNAVAILABLE = 'ToolsUnavailable'
# class VMwareDriverException(Exception):
# class VimException(VMwareDriverException):
# class VimSessionOverLoadException(VMwareDriverException):
# class VimConnectionException(VMwareDriverException):
# class VimAttributeException(VMwareDriverException):
# class VimFaultException(VimException):
# class ImageTransferException(VMwareDriverException):
# class VMwareDriverConfigurationException(VMwareDriverException):
# class UseLinkedCloneConfigurationFault(VMwareDriverConfigurationException):
# class MissingParameter(VMwareDriverException):
# class AlreadyExistsException(VimException):
# class CannotDeleteFileException(VimException):
# class FileAlreadyExistsException(VimException):
# class FileFaultException(VimException):
# class FileLockedException(VimException):
# class FileNotFoundException(VimException):
# class InvalidPowerStateException(VimException):
# class InvalidPropertyException(VimException):
# class NoPermissionException(VimException):
# class NotAuthenticatedException(VimException):
# class TaskInProgress(VimException):
# class DuplicateName(VimException):
# class NoDiskSpaceException(VimException):
# class ToolsUnavailableException(VimException):
# class ManagedObjectNotFoundException(VimException):
#     def __str__(self):
#     def __init__(self, message=None, details=None, **kwargs):
#     def msg(self):
#     def description(self):
#     def __init__(self, message=None, cause=None, details=None, **kwargs):
#     def __init__(self, message, cause=None):
#     def __init__(self, message, cause=None):
#     def __init__(self, message, cause=None):
#     def __init__(self, fault_list, message, cause=None, details=None):
#     def description(self):
#     def __init__(self, message, cause=None):
# def _print_deprecation_warning(clazz):
#     def __init__(self, message=None, details=None, **kwargs):
#     def __init__(self, message=None, details=None, **kwargs):
# def get_fault_class(name):
# def translate_fault(localized_method_fault, excep_msg=None):
# def register_fault_class(name, exception):
# 
# Path: oslo_vmware/vim.py
# class Vim(service.Service):
#     def __init__(self, protocol='https', host='localhost', port=None,
#                  wsdl_url=None, cacert=None, insecure=True, pool_maxsize=10,
#                  connection_timeout=None, op_id_prefix='oslo.vmware'):
#     def retrieve_service_content(self):
#     def __repr__(self):
#     def __str__(self):


# Path: oslo_vmware/tests/test_vim.py
import copy
import suds
from unittest import mock
from oslo_i18n import fixture as i18n_fixture
from oslo_vmware import exceptions
from oslo_vmware.tests import base
from oslo_vmware import vim

    def test_configure_with_wsdl_url_override(self):
        vim_obj = vim.Vim('https', 'www.example.com',
                          wsdl_url='https://test.com/sdk/vimService.wsdl')
        self.assertEqual('https://test.com/sdk/vimService.wsdl',
                         vim_obj.wsdl_url)
        self.assertEqual('https://www.example.com/sdk', vim_obj.soap_url)


class VMwareSudsTest(base.TestCase):
    def setUp(self):
        super(VMwareSudsTest, self).setUp()

        def new_client_init(self, url, **kwargs):
            return

        mock.patch.object(suds.client.Client,
                          '__init__', new=new_client_init).start()
        self.addCleanup(mock.patch.stopall)
        self.vim = self._vim_create()

    def _mock_getattr(self, attr_name):
        class fake_service_content(object):
            def __init__(self):
                self.ServiceContent = {}
                self.ServiceContent.fake = 'fake'

        self.assertEqual("RetrieveServiceContent", attr_name)
        return lambda obj, **kwargs: fake_service_content()

    def _vim_create(self):

        with mock.patch.object(vim.Vim, '__getattr__', self._mock_getattr):