keystone/tests/test_config.py
Jamie Lennox 3afd9791ef Isolate eventlet code into environment.
The environment module will be configured once, during code initialization.
Subsequently all other possibly-evented modules will retrieve from
environment and transparently obtain either the eventlet or standard
library modules.

If eventlet, httplib, subprocess or other environment dependant module
is referenced outside of the environment module it should be considered
a bug.

The changes to tests are required to ensure that test is imported first
to setup the environment. Hopefully these can all be replaced with an
__init__.py in a post-nose keystone.

Implements: blueprint extract-eventlet
Change-Id: Icacd6f2ee0906ac5d303777c1f87a184f38283bf
2013-06-18 14:10:36 -04:00

20 lines
635 B
Python

from keystone import test
from keystone import config
from keystone import exception
CONF = config.CONF
class ConfigTestCase(test.TestCase):
def test_paste_config(self):
self.assertEqual(config.find_paste_config(),
test.etcdir('keystone-paste.ini'))
self.opt_in_group('paste_deploy', config_file='XYZ')
self.assertRaises(exception.PasteConfigNotFound,
config.find_paste_config)
self.opt_in_group('paste_deploy', config_file='')
self.assertEqual(config.find_paste_config(),
test.etcdir('keystone.conf.sample'))