Rename BaseApiTest.config to app_config

TestCase has a method named config(). Then DbTestCase inherits
from TestCase, and BaseApiTest inherits from DbTestCase.
BaseApiTest also have an attribute named "config" used to
configure the pecan app for tests. So when a test class inherited
from BaseApiTest calls config(), it gets a "Dict is not callable"
exception.

This patch rename BaseApiTest.config to BaseApiTest.app_config
to avoid this problem.


Change-Id: I1b020d0ac8d7068bd029fbb4b44b667ec7f01513
This commit is contained in:
Tang Chen 2016-08-08 13:30:39 +08:00
parent c3a376b18d
commit 4f34242ca1

View File

@ -65,7 +65,7 @@ class BaseApiTest(base.DbTestCase):
# Determine where we are so we can set up paths in the config
root_dir = self.path_get()
self.config = {
self.app_config = {
'app': {
'root': 'ironic.api.controllers.root.RootController',
'modules': ['ironic.api'],
@ -74,7 +74,7 @@ class BaseApiTest(base.DbTestCase):
'acl_public_routes': ['/', '/v1'],
},
}
return pecan.testing.load_test_app(self.config)
return pecan.testing.load_test_app(self.app_config)
def _request_json(self, path, params, expect_errors=False, headers=None,
method="post", extra_environ=None, status=None,