def setUp(self):
        super(ServiceCatalogTest, self).setUp()
        self.AUTH_RESPONSE_BODY = client_fixtures.auth_response_body()
        self.RESPONSE = utils.TestResponse(
            {"headers": client_fixtures.AUTH_RESPONSE_HEADERS})

        self.north_endpoints = {
            'public': 'http://glance.north.host/glanceapi/public',
            'internal': 'http://glance.north.host/glanceapi/internal',
            'admin': 'http://glance.north.host/glanceapi/admin'
        }

        self.south_endpoints = {
            'public': 'http://glance.south.host/glanceapi/public',
            'internal': 'http://glance.south.host/glanceapi/internal',
            'admin': 'http://glance.south.host/glanceapi/admin'
        }
Пример #2
0
#    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.

import datetime
import uuid

from oslo_utils import timeutils

from keystoneclient import access
from keystoneclient import fixture
from keystoneclient.tests.unit.v3 import client_fixtures
from keystoneclient.tests.unit.v3 import utils

TOKEN_RESPONSE = utils.TestResponse(
    {"headers": client_fixtures.AUTH_RESPONSE_HEADERS})
UNSCOPED_TOKEN = client_fixtures.unscoped_token()
DOMAIN_SCOPED_TOKEN = client_fixtures.domain_scoped_token()
PROJECT_SCOPED_TOKEN = client_fixtures.project_scoped_token()


class AccessInfoTest(utils.TestCase):
    def test_building_unscoped_accessinfo(self):
        auth_ref = access.AccessInfo.factory(resp=TOKEN_RESPONSE,
                                             body=UNSCOPED_TOKEN)

        self.assertTrue(auth_ref)
        self.assertIn('methods', auth_ref)
        self.assertNotIn('catalog', auth_ref)

        self.assertEqual(auth_ref.auth_token,