Example #1
0
 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
Example #2
0
    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
Example #3
0
 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)
 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)