"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/tests/unit/identity/shadow_users/test_core.py" between
keystone-16.0.1.tar.gz and keystone-17.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Ussuri" series (latest release).

test_core.py  (keystone-16.0.1):test_core.py  (keystone-17.0.0)
skipping to change at line 15 skipping to change at line 15
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import uuid import uuid
from keystone.common import driver_hints
from keystone.common import provider_api from keystone.common import provider_api
PROVIDERS = provider_api.ProviderAPIs PROVIDERS = provider_api.ProviderAPIs
class ShadowUsersCoreTests(object): class ShadowUsersCoreTests(object):
def test_shadow_federated_user(self): def test_shadow_federated_user(self):
user = PROVIDERS.identity_api.shadow_federated_user( user = PROVIDERS.identity_api.shadow_federated_user(
self.federated_user['idp_id'], self.federated_user['idp_id'],
self.federated_user['protocol_id'], self.federated_user['protocol_id'],
self.federated_user['unique_id'], self.federated_user['unique_id'],
skipping to change at line 64 skipping to change at line 65
self.federated_user['idp_id'], self.federated_user['idp_id'],
self.federated_user['protocol_id'], self.federated_user['protocol_id'],
self.federated_user['unique_id'], self.federated_user['unique_id'],
self.federated_user['display_name']) self.federated_user['display_name'])
self.assertEqual(self.federated_user['display_name'], self.assertEqual(self.federated_user['display_name'],
shadow_user2['name']) shadow_user2['name'])
self.assertNotEqual(shadow_user1['name'], shadow_user2['name']) self.assertNotEqual(shadow_user1['name'], shadow_user2['name'])
# The shadowed users still share the same unique ID. # The shadowed users still share the same unique ID.
self.assertEqual(shadow_user1['id'], shadow_user2['id']) self.assertEqual(shadow_user1['id'], shadow_user2['id'])
def test_shadow_federated_user_not_creating_a_local_user(self):
PROVIDERS.identity_api.shadow_federated_user(
self.federated_user['idp_id'],
self.federated_user['protocol_id'],
self.federated_user['unique_id'],
self.federated_user['display_name'],
"some_id@mail.provider")
hints = driver_hints.Hints()
hints.add_filter('name', self.federated_user['display_name'])
users = PROVIDERS.identity_api.list_users(hints=hints)
self.assertEqual(1, len(users))
# Avoid caching
self.federated_user['display_name'] = uuid.uuid4().hex
PROVIDERS.identity_api.shadow_federated_user(
self.federated_user['idp_id'],
self.federated_user['protocol_id'],
self.federated_user['unique_id'],
self.federated_user['display_name'],
"some_id@mail.provider")
hints.add_filter('name', self.federated_user['display_name'])
users = PROVIDERS.identity_api.list_users(hints=hints)
# The number os users must remain 1
self.assertEqual(1, len(users))
 End of changes. 2 change blocks. 
0 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)