def test_cgPickling_basic(self): loc1 = LocationA(value=10) self.assertPicklable(loc1) loc2 = LocationA(value=(1, 2, 3)) self.assertPicklable(loc2) loc3 = LocationA(value=({1: 2}, "2", 3, 4.0, None, 5L)) self.assertPicklable(loc3) loc4 = LocationB(value=loc1, value2=loc2) self.assertPicklable(loc4) loc4 = LocationB(value=loc4, value2=loc4) self.assertPicklable(loc4) #verify that the override worked self.assertTrue("__LocB__" in repr(JsonPickle.toSimple(loc4)))
def test_cgPickling_basic(self): loc1 = LocationA(value = 10) self.assertPicklable(loc1) loc2 = LocationA(value = (1,2,3)) self.assertPicklable(loc2) loc3 = LocationA(value = ({1:2},"2",3, 4.0, None, 5L)) self.assertPicklable(loc3) loc4 = LocationB(value=loc1, value2=loc2) self.assertPicklable(loc4) loc4 = LocationB(value=loc4, value2=loc4) self.assertPicklable(loc4) #verify that the override worked self.assertTrue("__LocB__" in repr(JsonPickle.toSimple(loc4)))
def keyspacePathToKeyspaceName(keyspacePath): return NativeJson.Json([JsonPickle.toSimple(x) for x in keyspacePath])