@@ -0,0 +1,1961 @@
+# -*- coding: utf-8 -*-%0A%0A# Copyright 2014 IBM Corp.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License at%0A#%0A#      http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A# License for the specific language governing permissions and limitations%0A# under the License.%0A%0A%0Aimport uuid%0A%0Afrom keystone.assignment import controllers%0Afrom keystone import exception%0Afrom keystone import tests%0Afrom keystone.tests import default_fixtures%0A%0A%0A_ADMIN_CONTEXT = %7B'is_admin': True%7D%0A%0A%0Aclass TenantTestCase(tests.TestCase):%0A    %22%22%22Tests for the V2 Tenant controller.%0A%0A    These tests exercise :class:%60keystone.assignment.controllers.Tenant%60.%0A%0A    %22%22%22%0A%0A    def test_get_project_users_no_user(self):%0A        %22%22%22get_project_users when user doesn't exist, raises UserNotFound.%0A%0A        When a user that's not known to %60identity%60 has a role on a project,%0A        then %60get_project_users%60 raises%0A        :class:%60keystone.exception.UserNotFound%60.%0A%0A        %22%22%22%0A%0A        self.load_backends()%0A        self.load_fixtures(default_fixtures)%0A        tenant_controller = controllers.Tenant()%0A        role_controller = controllers.Role()%0A%0A        # Assign a role to a user that doesn't exist to the %60bar%60 project.%0A%0A        project_id = self.tenant_bar%5B'id'%5D%0A%0A        user_id = uuid.uuid4().hex%0A        role_controller.add_role_to_user(%0A            _ADMIN_CONTEXT, user_id, self.role_other%5B'id'%5D, project_id)%0A%0A        self.assertRaisesRegexp(exception.UserNotFound,%0A                                'Could not find user, %25s' %25 user_id,%0A                                tenant_controller.get_project_users,%0A                                _ADMIN_CONTEXT, project_id)%0A

Add test for list project users when no user