Esempio n. 1
0
    def test_user_key2scim(self):
        keystone = {
            'id': '19041ee7679649879ada04417753ad4d',
            'domain_id': '91d79dc2211d43a7985ebc27cdd146df',
            'email': '*****@*****.**',
            'name': 'alice',
            'description': 'Alice Smith',
            'enabled': True
        }

        scim = {
            'schemas': ['urn:scim:schemas:core:1.0',
                        'urn:scim:schemas:extension:keystone:1.0'],
            'id': '19041ee7679649879ada04417753ad4d',
            'userName': '******',
            'displayName': 'Alice Smith',
            'emails': [
                {
                    'value': '*****@*****.**'
                }
            ],
            'active': True,
            'urn:scim:schemas:extension:keystone:1.0': {
                'domain_id': '91d79dc2211d43a7985ebc27cdd146df'
            }
        }

        self.assertEqual(scim, conv.user_key2scim(keystone, path='v1'))
Esempio n. 2
0
    def test_user_key2scim(self):
        keystone = {
            'id': '19041ee7679649879ada04417753ad4d',
            'domain_id': '91d79dc2211d43a7985ebc27cdd146df',
            'email': '*****@*****.**',
            'name': 'alice',
            'description': 'Alice Smith',
            'enabled': True
        }

        scim = {
            'schemas': [
                'urn:scim:schemas:core:1.0',
                'urn:scim:schemas:extension:keystone:1.0'
            ],
            'id':
            '19041ee7679649879ada04417753ad4d',
            'userName':
            '******',
            'displayName':
            'Alice Smith',
            'emails': [{
                'value': '*****@*****.**'
            }],
            'active':
            True,
            'urn:scim:schemas:extension:keystone:1.0': {
                'domain_id': '91d79dc2211d43a7985ebc27cdd146df'
            }
        }

        self.assertEqual(scim, conv.user_key2scim(keystone, path='v1'))
Esempio n. 3
0
    def test_user_scim2key_utf8(self):
        scim = {
            'userName':
            u'alice',
            'urn:scim:schemas:extension:keystone:1.0': {
                u'domain_id': u'91d79dc2211d43a7985ebc27cdd146df'
            },
            'emails': [{
                u'value': u'*****@*****.**'
            }],
            'active':
            True,
            'id':
            u'19041ee7679649879ada04417753ad4d',
            'schemas': [
                u'urn:scim:schemas:core:1.0',
                u'urn:scim:schemas:extension:keystone:1.0'
            ]
        }

        keystone = {
            'id': '19041ee7679649879ada04417753ad4d',
            'domain_id': '91d79dc2211d43a7985ebc27cdd146df',
            'email': '*****@*****.**',
            'name': 'alice',
            'enabled': True
        }

        self.assertEqual(scim, conv.user_key2scim(keystone, path='v1'))
Esempio n. 4
0
    def test_user_key2scim_no_mandatory_fields(self):
        keystone = {
            'id': '19041ee7679649879ada04417753ad4d',
            'domain_id': '91d79dc2211d43a7985ebc27cdd146df',
        }

        scim = {
            'schemas': ['urn:scim:schemas:core:1.0',
                        'urn:scim:schemas:extension:keystone:1.0'],
            'id': '19041ee7679649879ada04417753ad4d',
            'urn:scim:schemas:extension:keystone:1.0': {
                'domain_id': '91d79dc2211d43a7985ebc27cdd146df'
            }
        }

        self.assertEqual(scim, conv.user_key2scim(keystone, path='v1'))
Esempio n. 5
0
    def test_user_key2scim_no_mandatory_fields(self):
        keystone = {
            'id': '19041ee7679649879ada04417753ad4d',
            'domain_id': '91d79dc2211d43a7985ebc27cdd146df',
        }

        scim = {
            'schemas': [
                'urn:scim:schemas:core:1.0',
                'urn:scim:schemas:extension:keystone:1.0'
            ],
            'id':
            '19041ee7679649879ada04417753ad4d',
            'urn:scim:schemas:extension:keystone:1.0': {
                'domain_id': '91d79dc2211d43a7985ebc27cdd146df'
            }
        }

        self.assertEqual(scim, conv.user_key2scim(keystone, path='v1'))
Esempio n. 6
0
    def test_user_scim2key_utf8(self):
        scim = {
            'userName': u'alice',
            'urn:scim:schemas:extension:keystone:1.0': {
                u'domain_id': u'91d79dc2211d43a7985ebc27cdd146df'
            },
            'emails': [{u'value': u'*****@*****.**'}],
            'active': True,
            'id': u'19041ee7679649879ada04417753ad4d',
            'schemas': [u'urn:scim:schemas:core:1.0',
                        u'urn:scim:schemas:extension:keystone:1.0']}

        keystone = {
            'id': '19041ee7679649879ada04417753ad4d',
            'domain_id': '91d79dc2211d43a7985ebc27cdd146df',
            'email': '*****@*****.**',
            'name': 'alice',
            'enabled': True
        }

        self.assertEqual(scim, conv.user_key2scim(keystone, path='v1'))