def testFunkyReferences(self): o = EvilSourceror(EvilSourceror([])) j1 = aot.jellyToAOT(o) oj = aot.unjellyFromAOT(j1) assert oj.a is oj assert oj.a.b is oj.b assert oj.c is not oj.c.c
def test_funkyReferences(self): o = EvilSourceror(EvilSourceror([])) j1 = aot.jellyToAOT(o) oj = aot.unjellyFromAOT(j1) assert oj.a is oj assert oj.a.b is oj.b assert oj.c is not oj.c.c
def test_circularTuple(self): """ L{aot.jellyToAOT} can persist circular references through tuples. """ l = [] t = (l, 4321) l.append(t) j1 = aot.jellyToAOT(l) oj = aot.unjellyFromAOT(j1) self.assertIsInstance(oj[0], tuple) self.assertIs(oj[0][0], oj) self.assertEqual(oj[0][1], 4321)