Ejemplo n.º 1
0
    def test_full_identity(self):
        ident = resources.IdentitySet(self.data)

        self.assertIsInstance(ident.user, resources.Identity)
        self.assertEqual(ident.user.id, self.data['user']['id'])
        self.assertEqual(ident.user.display_name,
                         self.data['user']['displayName'])

        self.assertIsInstance(ident.device, resources.Identity)
        self.assertEqual(ident.device.id, self.data['device']['id'])
        self.assertEqual(ident.device.display_name,
                         self.data['device']['displayName'])

        self.assertIsInstance(ident.application, resources.Identity)
        self.assertEqual(ident.application.id, self.data['application']['id'])
        self.assertEqual(ident.application.display_name,
                         self.data['application']['displayName'])
Ejemplo n.º 2
0
 def last_modified_by(self):
     """
     :rtype: resources.IdentitySet
     """
     return resources.IdentitySet(self._data['lastModifiedBy'])
Ejemplo n.º 3
0
 def created_by(self):
     """
     :rtype: resources.IdentitySet
     """
     return resources.IdentitySet(self._data['createdBy'])
Ejemplo n.º 4
0
 def test_partial_identity(self):
     del self.data['user']
     ident = resources.IdentitySet(self.data)
     self.assertIsNone(ident.user)
     self.assertIsInstance(ident.device, resources.Identity)
     self.assertIsInstance(ident.application, resources.Identity)