Add unit tests for _get_unversioned_endpoint
This commit adds the first unit tests for the verify_tempest_config script which covers the code used to format an unversioned endpoint from a versioned one returned from the keystone catalog. This also breaks that section of the script off into a separate method so that mocks were not needed for such a simple test case. Partially implements bp: config-verification Change-Id: I6f48034af5fc187f6ae7d5c9b3dccb61f309ae25changes/37/89937/4
parent
f8b816af07
commit
9b89624925
@ -0,0 +1,30 @@
|
||||
# Copyright 2014 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
|
||||
from tempest.cmd import verify_tempest_config
|
||||
from tempest.tests import base
|
||||
|
||||
|
||||
class TestGetAPIVersions(base.TestCase):
|
||||
|
||||
def test_url_grab_versioned_nova_nossl(self):
|
||||
base_url = 'http://127.0.0.1:8774/v2/'
|
||||
endpoint = verify_tempest_config._get_unversioned_endpoint(base_url)
|
||||
self.assertEqual('http://127.0.0.1:8774', endpoint)
|
||||
|
||||
def test_url_grab_versioned_nova_ssl(self):
|
||||
base_url = 'https://127.0.0.1:8774/v3/'
|
||||
endpoint = verify_tempest_config._get_unversioned_endpoint(base_url)
|
||||
self.assertEqual('https://127.0.0.1:8774', endpoint)
|
Loading…
Reference in New Issue