Don't apply config fixture to auth_token.CONF

auth_token.CONF is simply the global oslo.config conf object linked into
the auth_token module. It is not intended for public use and has
recently been moved.

We can mock exactly the same entries without having to reach into
auth_token middleware and should do that instead.

Closes-Bug: #1600529
Change-Id: I5e8a481f37a7b409e491ce893a0e898d5085cc75
This commit is contained in:
Jamie Lennox 2016-07-11 09:24:26 +10:00
parent eccc58f7af
commit 0bd4a6c286
3 changed files with 3 additions and 7 deletions

View File

@ -34,7 +34,6 @@ from cinder.tests.unit import fake_constants as fake
from cinder.tests.unit import test_db_api
from keystonemiddleware import auth_token
from oslo_config import cfg
from oslo_config import fixture as config_fixture
@ -114,7 +113,7 @@ class QuotaSetsControllerTestBase(test.TestCase):
self.addCleanup(list_patcher.stop)
self.auth_url = 'http://localhost:5000'
self.fixture = self.useFixture(config_fixture.Config(auth_token.CONF))
self.fixture = self.useFixture(config_fixture.Config(CONF))
self.fixture.config(auth_uri=self.auth_url, group='keystone_authtoken')
def _create_project_hierarchy(self):

View File

@ -38,8 +38,6 @@ from cinder.tests.unit import fake_constants as fake
import cinder.tests.unit.image.fake
from cinder import volume
from keystonemiddleware import auth_token
CONF = cfg.CONF
@ -1425,7 +1423,7 @@ class NestedDbQuotaDriverBaseTestCase(DbQuotaDriverBaseTestCase):
keystone_patcher.start()
self.addCleanup(keystone_patcher.stop)
self.fixture = self.useFixture(config_fixture.Config(auth_token.CONF))
self.fixture = self.useFixture(config_fixture.Config(CONF))
self.fixture.config(auth_uri=self.auth_url, group='keystone_authtoken')
self.driver = quota.NestedDbQuotaDriver()

View File

@ -21,7 +21,6 @@ from cinder import quota_utils
from cinder import test
from keystoneclient import exceptions
from keystonemiddleware import auth_token
from oslo_config import cfg
from oslo_config import fixture as config_fixture
@ -43,7 +42,7 @@ class QuotaUtilsTest(test.TestCase):
self.auth_url = 'http://localhost:5000'
self.context = context.RequestContext('fake_user', 'fake_proj_id')
self.fixture = self.useFixture(config_fixture.Config(auth_token.CONF))
self.fixture = self.useFixture(config_fixture.Config(CONF))
self.fixture.config(auth_uri=self.auth_url, group='keystone_authtoken')
@mock.patch('keystoneclient.client.Client')