Example #1
0
    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'
        }
Example #2
0
#         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.

import datetime

from keystoneclient import access
from keystoneclient.openstack.common import timeutils
from keystoneclient.tests.v3 import client_fixtures
from keystoneclient.tests.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.assertIn('catalog', auth_ref)
        self.assertFalse(auth_ref['catalog'])
 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})