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 testCreationFromToken(self): token = StorageToken(None, self.TEST_CLASS.CLASS_ID) instance = Serializable.createFromToken(token)
def test__init__(self): anId = uuid.uuid4() strId = str(anId) self.assertIsInstance(Serializable(), Serializable) self.assertIsInstance(Serializable(anId), Serializable) self.assertIsInstance(Serializable(strId), Serializable)