def testRpickleInterface(self): if IGNORE_TEST: return serialization = rpickle.Serialization(self.bootstrapResult) bootstrapResult = serialization.deserialize() self.assertTrue( bootstrapResult.fittedStatistic.meanTS.equals( self.bootstrapResult.fittedStatistic.meanTS))
def testDeserialize(self): if IGNORE_TEST: return for obj in self.objs: serialization = rpickle.Serialization(obj) serialization.serialize() new_obj = serialization.deserialize() self.assertTrue(obj.equals(new_obj))
def test(obj, hasSerialization): serialization = rpickle.Serialization(obj) serialization.serialize() values = [v for v in serialization.dct.values()] isPresent = any([isinstance(v, rpickle.Serialization) for v in values]) if hasSerialization: self.assertTrue(isPresent) else: self.assertFalse(isPresent)
def testConstructor(self): if IGNORE_TEST: return for obj in self.objs: serialization = rpickle.Serialization(obj) self.assertEqual(obj.__class__, serialization.cls) trues = [obj.__dict__[k] == serialization.dct[k] for k in serialization.dct.keys()] self.assertTrue(all(trues))
def testRpickleInterface(self): if IGNORE_TEST: return serialization = rpickle.Serialization(self.timeseries) timeseries = serialization.deserialize() self.assertTrue(timeseries.equals(self.timeseries))
def testRpickleInterface(self): if IGNORE_TEST: return serialization = rpickle.Serialization(self.statistic) statistic = serialization.deserialize() self.assertTrue(statistic.meanTS.equals(self.statistic.meanTS))