Rename the actual plugin class to AdminToken
This is a new library, so there is no real need to keep backwards compat with the old confusing name. Change-Id: I9984473bceffb5f1f4edf76b3f111f467df023ed
This commit is contained in:
parent
3633d3634d
commit
cf4ef2ca87
|
@ -14,14 +14,14 @@ from keystoneauth1 import loading
|
|||
from keystoneauth1 import token_endpoint
|
||||
|
||||
|
||||
class TokenEndpoint(loading.BaseLoader):
|
||||
class AdminToken(loading.BaseLoader):
|
||||
|
||||
@property
|
||||
def plugin_class(self):
|
||||
return token_endpoint.TokenEndpoint
|
||||
|
||||
def get_options(self):
|
||||
options = super(TokenEndpoint, self).get_options()
|
||||
options = super(AdminToken, self).get_options()
|
||||
|
||||
options.extend([
|
||||
loading.Opt('endpoint',
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
from testtools import matchers
|
||||
|
||||
from keystoneauth1.loading._plugins import token_endpoint as loader
|
||||
from keystoneauth1.loading._plugins.identity import admin_token as loader
|
||||
from keystoneauth1 import session
|
||||
from keystoneauth1.tests.unit import utils
|
||||
from keystoneauth1 import token_endpoint
|
||||
|
@ -47,14 +47,6 @@ class TokenEndpointTest(utils.TestCase):
|
|||
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 loader.TokenEndpoint().get_options()]
|
||||
|
||||
self.assertThat(opt_names, matchers.HasLength(2))
|
||||
|
||||
self.assertIn('token', opt_names)
|
||||
self.assertIn('endpoint', opt_names)
|
||||
|
||||
def test_token_endpoint_user_id(self):
|
||||
a = token_endpoint.Token(self.TEST_URL, self.TEST_TOKEN)
|
||||
s = session.Session()
|
||||
|
@ -62,3 +54,14 @@ class TokenEndpointTest(utils.TestCase):
|
|||
# we can't know this information about this sort of plugin
|
||||
self.assertIsNone(a.get_user_id(s))
|
||||
self.assertIsNone(a.get_project_id(s))
|
||||
|
||||
|
||||
class AdminTokenTest(utils.TestCase):
|
||||
|
||||
def test_token_endpoint_options(self):
|
||||
opt_names = [opt.name for opt in loader.AdminToken().get_options()]
|
||||
|
||||
self.assertThat(opt_names, matchers.HasLength(2))
|
||||
|
||||
self.assertIn('token', opt_names)
|
||||
self.assertIn('endpoint', opt_names)
|
||||
|
|
|
@ -28,7 +28,7 @@ packages =
|
|||
keystoneauth1.plugin =
|
||||
password = keystoneauth1.loading._plugins.identity.generic:Password
|
||||
token = keystoneauth1.loading._plugins.identity.generic:Token
|
||||
admin_token = keystoneauth1.loading._plugins.token_endpoint:Token
|
||||
admin_token = keystoneauth1.loading._plugins.identity.admin_token:AdminToken
|
||||
v2password = keystoneauth1.loading._plugins.identity.v2:Password
|
||||
v2token = keystoneauth1.loading._plugins.identity.v2:Token
|
||||
v3password = keystoneauth1.loading._plugins.identity.v3:Password
|
||||
|
|
Loading…
Reference in New Issue