# Path: oslo_vmware/_i18n.py

# 
# 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):


from unittest import mock
from oslo_vmware._i18n import _
from oslo_vmware import exceptions
from oslo_vmware.tests import base
        return VimSubClass

    def test_register_fault_class(self):
        exc = self._create_subclass_exception()
        exceptions.register_fault_class('ValueError', exc)
        self.assertEqual(exc, exceptions.get_fault_class('ValueError'))

    def test_register_fault_class_override(self):
        exc = self._create_subclass_exception()
        exceptions.register_fault_class(exceptions.ALREADY_EXISTS, exc)
        self.assertEqual(exc,
                         exceptions.get_fault_class(exceptions.ALREADY_EXISTS))

    def test_register_fault_class_invalid(self):
        self.assertRaises(TypeError,
                          exceptions.register_fault_class,
                          'ValueError', ValueError)

    def test_log_exception_to_string(self):
        self.assertEqual('Insufficient disk space.',
                         str(exceptions.NoDiskSpaceException()))

    def test_get_fault_class(self):
        self.assertEqual(exceptions.AlreadyExistsException,
                         exceptions.get_fault_class("AlreadyExists"))
        self.assertEqual(exceptions.CannotDeleteFileException,
                         exceptions.get_fault_class("CannotDeleteFile"))
        self.assertEqual(exceptions.FileAlreadyExistsException,
                         exceptions.get_fault_class("FileAlreadyExists"))
        self.assertEqual(exceptions.FileFaultException,

# Path: oslo_vmware/_i18n.py

# 
# 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/tests/test_exceptions.py
from unittest import mock
from oslo_vmware._i18n import _
from oslo_vmware import exceptions
from oslo_vmware.tests import base

        return VimSubClass

    def test_register_fault_class(self):
        exc = self._create_subclass_exception()
        exceptions.register_fault_class('ValueError', exc)
        self.assertEqual(exc, exceptions.get_fault_class('ValueError'))

    def test_register_fault_class_override(self):
        exc = self._create_subclass_exception()
        exceptions.register_fault_class(exceptions.ALREADY_EXISTS, exc)
        self.assertEqual(exc,
                         exceptions.get_fault_class(exceptions.ALREADY_EXISTS))

    def test_register_fault_class_invalid(self):
        self.assertRaises(TypeError,
                          exceptions.register_fault_class,
                          'ValueError', ValueError)

    def test_log_exception_to_string(self):
        self.assertEqual('Insufficient disk space.',
                         str(exceptions.NoDiskSpaceException()))

    def test_get_fault_class(self):
        self.assertEqual(exceptions.AlreadyExistsException,
                         exceptions.get_fault_class("AlreadyExists"))
        self.assertEqual(exceptions.CannotDeleteFileException,
                         exceptions.get_fault_class("CannotDeleteFile"))
        self.assertEqual(exceptions.FileAlreadyExistsException,
                         exceptions.get_fault_class("FileAlreadyExists"))
        self.assertEqual(exceptions.FileFaultException,

                         exceptions.get_fault_class("FileFault"))