def test_grant_revoke_role_user_domain(self):
        if self.identity_version in ('2', '2.0'):
            self.skipTest("Identity service does not support domain")
        role_name = self.role_prefix + '_grant_user_domain'
        role = self.cloud.create_role(role_name)
        user_name = self.user_prefix + '_user_domain'
        user_email = 'nobody@nowhere.com'
        user = self._create_user(name=user_name,
                                 email=user_email,
                                 default_project='demo')
        self.assertTrue(self.cloud.grant_role(
            role_name, user=user['id'], domain='default'))
        assignments = self.cloud.list_role_assignments({
            'role': role['id'],
            'user': user['id'],
            'domain': self.cloud.get_domain('default')['id']
        })
        self.assertIsInstance(assignments, list)
        self.assertTrue(len(assignments) == 1)
        self.assertTrue(self.cloud.revoke_role(
            role_name, user=user['id'], domain='default'))
        assignments = self.cloud.list_role_assignments({
            'role': role['id'],
            'user': user['id'],
            'domain': self.cloud.get_domain('default')['id']
        })
        self.assertIsInstance(assignments, list)
        self.assertTrue(len(assignments) == 0)
dataset/ETHPy150Open openstack-infra/shade/shade/tests/functional/test_identity.py/TestIdentity.test_grant_revoke_role_user_domain/original