def testUnserialize(self): x = rinterface.IntSexpVector([1,2,3]) x_serialized = x.__getstate__() x_again = rinterface.unserialize(x_serialized, x.typeof) identical = rinterface.baseenv["identical"] self.assertFalse(x.rsame(x_again)) self.assertTrue(identical(x, x_again)[0])
def testUnserialize(self): x = rinterface.IntSexpVector([1, 2, 3]) x_serialized = x.__getstate__() x_again = rinterface.unserialize(x_serialized, x.typeof) identical = rinterface.baseenv["identical"] self.assertFalse(x.rsame(x_again)) self.assertTrue(identical(x, x_again)[0])
def test_unserialize(): x = rinterface.IntSexpVector([1, 2, 3]) x_serialized = x.__getstate__() x_again = rinterface.Sexp(rinterface.unserialize(x_serialized)) identical = rinterface.baseenv['identical'] assert not x.rsame(x_again) assert identical(x, x_again)[0]