# Path: castellan/_config_driver.py
# LOG = log.getLogger(__name__)
# class CastellanConfigurationSourceDriver(sources.ConfigurationSourceDriver):
# class CastellanConfigurationSource(sources.ConfigurationSource):
#     def list_options_for_discovery(self):
#     def open_source_from_opt_group(self, conf, group_name):
#     def __init__(self, group_name, config_file, mapping_file):
#     def get(self, group_name, option_name, opt):
# 
# Path: castellan/common/objects/opaque_data.py
# class OpaqueData(managed_object.ManagedObject):
#     def __init__(self, data, name=None, created=None, id=None):
#     def managed_type(cls):
#     def format(self):
#     def get_encoded(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
# 
# Path: castellan/tests/unit/key_manager/fake.py
# def fake_api():


import tempfile
from oslo_config import cfg
from oslo_config import fixture
from oslotest import base
from castellan import _config_driver
from castellan.common.objects import opaque_data
from castellan.tests.unit.key_manager import fake

class CastellanSourceTestCase(base.BaseTestCase):

    def setUp(self):
        super(CastellanSourceTestCase, self).setUp()
        self.driver = _config_driver.CastellanConfigurationSourceDriver()
        self.conf = cfg.ConfigOpts()
        self.conf_fixture = self.useFixture(fixture.Config(self.conf))

    def test_incomplete_driver(self):
        # The group exists, but does not specify the
        # required options for this driver.
        self.conf_fixture.load_raw_values(
            group='incomplete_driver',
            driver='castellan',
        )
        source = self.conf._open_source_from_opt_group('incomplete_driver')

        self.assertIsNone(source)
        self.assertEqual(self.conf.incomplete_driver.driver, 'castellan')

    def test_complete_driver(self):
        self.conf_fixture.load_raw_values(
            group='castellan_source',
            driver='castellan',
            config_file='config.conf',
            mapping_file='mapping.conf',
        )

        with base.mock.patch.object(

# Path: castellan/_config_driver.py
# LOG = log.getLogger(__name__)
# class CastellanConfigurationSourceDriver(sources.ConfigurationSourceDriver):
# class CastellanConfigurationSource(sources.ConfigurationSource):
#     def list_options_for_discovery(self):
#     def open_source_from_opt_group(self, conf, group_name):
#     def __init__(self, group_name, config_file, mapping_file):
#     def get(self, group_name, option_name, opt):
# 
# Path: castellan/common/objects/opaque_data.py
# class OpaqueData(managed_object.ManagedObject):
#     def __init__(self, data, name=None, created=None, id=None):
#     def managed_type(cls):
#     def format(self):
#     def get_encoded(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
# 
# Path: castellan/tests/unit/key_manager/fake.py
# def fake_api():


# Path: castellan/tests/unit/test_config_driver.py
import tempfile
from oslo_config import cfg
from oslo_config import fixture
from oslotest import base
from castellan import _config_driver
from castellan.common.objects import opaque_data
from castellan.tests.unit.key_manager import fake


class CastellanSourceTestCase(base.BaseTestCase):

    def setUp(self):
        super(CastellanSourceTestCase, self).setUp()
        self.driver = _config_driver.CastellanConfigurationSourceDriver()
        self.conf = cfg.ConfigOpts()
        self.conf_fixture = self.useFixture(fixture.Config(self.conf))

    def test_incomplete_driver(self):
        # The group exists, but does not specify the
        # required options for this driver.
        self.conf_fixture.load_raw_values(
            group='incomplete_driver',
            driver='castellan',
        )
        source = self.conf._open_source_from_opt_group('incomplete_driver')

        self.assertIsNone(source)
        self.assertEqual(self.conf.incomplete_driver.driver, 'castellan')

    def test_complete_driver(self):
        self.conf_fixture.load_raw_values(
            group='castellan_source',
            driver='castellan',
            config_file='config.conf',
            mapping_file='mapping.conf',
        )

        with base.mock.patch.object(

                _config_driver,