Merge "Fix importing config module and classmethod params"

This commit is contained in:
Jenkins 2014-12-04 15:09:03 +00:00 committed by Gerrit Code Review
commit 6f2be1341d
2 changed files with 14 additions and 2 deletions

View File

@ -10,6 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
from keystoneclient.auth import base
@ -38,8 +39,9 @@ class Token(base.BaseAuthPlugin):
"""
return self.endpoint
def get_options(self):
options = super(Token, self).get_options()
@classmethod
def get_options(cls):
options = super(Token, cls).get_options()
options.extend([
cfg.StrOpt('endpoint',

View File

@ -10,6 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from testtools import matchers
from keystoneclient.auth import token_endpoint
from keystoneclient import session
from keystoneclient.tests import utils
@ -43,3 +45,11 @@ class TokenEndpointTest(utils.TestCase):
self.assertEqual(self.TEST_URL, a.get_endpoint(s))
self.assertEqual('body', data.text)
self.assertRequestHeaderEqual('X-Auth-Token', self.TEST_TOKEN)
def test_token_endpoint_options(self):
opt_names = [opt.name for opt in token_endpoint.Token.get_options()]
self.assertThat(opt_names, matchers.HasLength(2))
self.assertIn('token', opt_names)
self.assertIn('endpoint', opt_names)