"Fossies" - the Fresh Open Source Software Archive

Member "keystone-17.0.0/keystone/tests/unit/test_backend_federation_sql.py" (13 May 2020, 2141 Bytes) of package /linux/misc/openstack/keystone-17.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test_backend_federation_sql.py": 16.0.1_vs_17.0.0.

    1 # Copyright 2013 OpenStack Foundation
    2 #
    3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
    4 # not use this file except in compliance with the License. You may obtain
    5 # a copy of the License at
    6 #
    7 #      http://www.apache.org/licenses/LICENSE-2.0
    8 #
    9 # Unless required by applicable law or agreed to in writing, software
   10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   12 # License for the specific language governing permissions and limitations
   13 # under the License.
   14 
   15 from keystone.common import sql
   16 from keystone.tests.unit import test_backend_sql
   17 
   18 
   19 class SqlFederation(test_backend_sql.SqlModels):
   20     """Set of tests for checking SQL Federation."""
   21 
   22     def test_identity_provider(self):
   23         cols = (('id', sql.String, 64),
   24                 ('domain_id', sql.String, 64),
   25                 ('enabled', sql.Boolean, None),
   26                 ('description', sql.Text, None),
   27                 ('authorization_ttl', sql.Integer, None))
   28         self.assertExpectedSchema('identity_provider', cols)
   29 
   30     def test_idp_remote_ids(self):
   31         cols = (('idp_id', sql.String, 64),
   32                 ('remote_id', sql.String, 255))
   33         self.assertExpectedSchema('idp_remote_ids', cols)
   34 
   35     def test_federated_protocol(self):
   36         cols = (('id', sql.String, 64),
   37                 ('idp_id', sql.String, 64),
   38                 ('mapping_id', sql.String, 64),
   39                 ('remote_id_attribute', sql.String, 64))
   40         self.assertExpectedSchema('federation_protocol', cols)
   41 
   42     def test_mapping(self):
   43         cols = (('id', sql.String, 64),
   44                 ('rules', sql.JsonBlob, None))
   45         self.assertExpectedSchema('mapping', cols)
   46 
   47     def test_service_provider(self):
   48         cols = (('auth_url', sql.String, 256),
   49                 ('id', sql.String, 64),
   50                 ('enabled', sql.Boolean, None),
   51                 ('description', sql.Text, None),
   52                 ('relay_state_prefix', sql.String, 256),
   53                 ('sp_url', sql.String, 256))
   54         self.assertExpectedSchema('service_provider', cols)