Example #1
0
 def initializeFromToken(self, token, context=None):
     super(TestClass3, self).initializeFromToken(token, context)
     for name, val in token.iteritems():
         if name not in token.RESERVED_KEYS:
             if isinstance(val, StorageToken):
                 val = Serializable.createFromToken(val, context)
             self._data[name] = val
 def initializeFromToken(self, token, context=None):
     super(TestClass3, self).initializeFromToken(token, context)
     for name, val in token.iteritems():
         if name not in token.RESERVED_KEYS:
             if isinstance(val, StorageToken):
                 val = Serializable.createFromToken(val, context)
             self._data[name] = val
Example #3
0
 def testCreationFromToken(self):
     token = StorageToken(None, self.TEST_CLASS.CLASS_ID)
     instance = Serializable.createFromToken(token)
Example #4
0
 def test__init__(self):
     anId = uuid.uuid4()
     strId = str(anId)
     self.assertIsInstance(Serializable(), Serializable)
     self.assertIsInstance(Serializable(anId), Serializable)
     self.assertIsInstance(Serializable(strId), Serializable)
 def testCreationFromToken(self):
     token = StorageToken(None, self.TEST_CLASS.CLASS_ID)
     instance = Serializable.createFromToken(token)