Chris Hoge | 4f6117a | 2015-03-20 12:39:33 -0500 | [diff] [blame^] | 1 | # Copyright 2015 OpenStack Foundation |
| 2 | # All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | # not use this file except in compliance with the License. You may obtain |
| 6 | # a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | # License for the specific language governing permissions and limitations |
| 14 | # under the License. |
| 15 | |
| 16 | from tempest.api.identity import base |
| 17 | from tempest import test |
| 18 | |
| 19 | |
| 20 | class TokensTest(base.BaseIdentityV2Test): |
| 21 | |
| 22 | @test.idempotent_id('65ae3b78-91ff-467b-a705-f6678863b8ec') |
| 23 | def test_create_token(self): |
| 24 | |
| 25 | token_client = self.non_admin_token_client |
| 26 | |
| 27 | # get a token for the user |
| 28 | creds = self.os.credentials |
| 29 | username = creds.username |
| 30 | password = creds.password |
| 31 | tenant_name = creds.tenant_name |
| 32 | |
| 33 | body = token_client.auth(username, |
| 34 | password, |
| 35 | tenant_name) |
| 36 | |
| 37 | self.assertEqual(body['token']['tenant']['name'], |
| 38 | tenant_name) |