diff options
author | Chmouel Boudjnah <chmouel@chmouel.com> | 2012-06-14 14:28:09 +0000 |
---|---|---|
committer | Chmouel Boudjnah <chmouel@chmouel.com> | 2012-06-27 19:19:37 +0000 |
commit | 2bcfe0b4c82ed3a333e3ffcf1d11423d57c2b761 (patch) | |
tree | a00912a6d122021abfc0c963a654a86da3f12c75 /tests/test_swiftclient.py | |
parent | 8396e3a4cb3daa6946844c23af22e01f44671834 (diff) | |
download | python-swiftclient-2bcfe0b4c82ed3a333e3ffcf1d11423d57c2b761.tar.gz |
Allow specify tenant:user in user.
We allow having the syntax tenant:user in user since this would make
things easier when switching from auth 1.0 to auth 2.0 and not having to
specify a tenant_name.
In the feature we should use the auth functions from keystoneclient and
be done with those changes, we could then auth by user/tenant-ID.
Change-Id: Ie49748105a678fb9369494e77d41d934d57a39a7
Diffstat (limited to 'tests/test_swiftclient.py')
-rw-r--r-- | tests/test_swiftclient.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_swiftclient.py b/tests/test_swiftclient.py index bf8adb9..b165dee 100644 --- a/tests/test_swiftclient.py +++ b/tests/test_swiftclient.py @@ -201,6 +201,20 @@ class TestGetAuth(MockHttpTest): 'http://www.tests.com', 'asdf', 'asdf', auth_version='2.0') + def test_auth_v2_with_tenant_user_in_user(self): + def read(*args, **kwargs): + acct_url = 'http://127.0.01/AUTH_FOO' + body = {'access': {'serviceCatalog': + [{u'endpoints': [{'publicURL': acct_url}], + 'type': 'object-store'}], + 'token': {'id': 'XXXXXXX'}}} + return c.json_dumps(body) + c.http_connection = self.fake_http_connection(200, return_read=read) + url, token = c.get_auth('http://www.test.com', 'foo:bar', 'asdf', + auth_version="2.0") + self.assertTrue(url.startswith("http")) + self.assertTrue(token) + class TestGetAccount(MockHttpTest): |