def test_tree(self):
     tree = RecTree()
     child = RecTree()
     tree.children = [child]
     ser = serialize(self.fac, tree)
     result = RecTree()
     result = deserialize(self.fac, ser, result)
     self.assertEqual(result, tree)
Beispiel #2
0
 def test_tree(self):
     tree = RecTree()
     child = RecTree()
     tree.children = [child]
     ser = serialize(fac, tree)
     result = RecTree()
     result = deserialize(fac, ser, result)
     self.assertEqual(result, tree)
Beispiel #3
0
 def test_corec(self):
     c = CoRec()
     r = CoRec2()
     c.other = r
     ser = serialize(fac, c)
     result = CoRec()
     result = deserialize(fac, ser, result)
     self.assertIsNotNone(c.other)
     self.assertIsNone(c.other.other)
 def test_corec(self):
     c = CoRec()
     r = CoRec2()
     c.other = r
     ser = serialize(self.fac, c)
     result = CoRec()
     result = deserialize(self.fac, ser, result)
     self.assertIsNotNone(c.other)
     self.assertIsNone(c.other.other)
 def test_list(self):
     l = RecList()
     l2 = RecList()
     l.next = l2
     ser = serialize(self.fac, l)
     result = RecList()
     result = deserialize(self.fac, ser, result)
     self.assertIsNotNone(result.next)
     self.assertIsNone(result.next.next)
Beispiel #6
0
 def test_list(self):
     l = RecList()
     l2 = RecList()
     l.next = l2
     ser = serialize(fac, l)
     result = RecList()
     result = deserialize(fac, ser, result)
     self.assertIsNotNone(result.next)
     self.assertIsNone(result.next.next)
 def decoder_array(self, data):
     return deserialize(factory, data, test_ttypes.Array()).data
 def decoder_string(self, data):
     return deserialize(factory, data, test_ttypes.Str()).data
 def decoder_points_list(self, data):
     return deserialize(
         factory,
         data,
         test_ttypes.PointsList(),
     ).points
 def decoder_simple_list(self, data):
     return deserialize(
         factory,
         data,
         test_ttypes.SimpleList(),
     ).ints
 def decoder_struct_map(self, data):
     return deserialize(
         factory,
         data,
         struct_map_ttypes.StructMap(),
     ).__dict__
 def decoder_struct_10(self, data):
     return deserialize(
         factory,
         data,
         test_ttypes.Struct10(),
     ).__dict__
 def decoder_map(self, data):
     return deserialize(factory, data, test_ttypes.Map()).data
 def decoder_boolean(self, data):
     return deserialize(factory, data, test_ttypes.Bool()).data
 def decoder_float(self, data):
     return deserialize(factory, data, test_ttypes.Float()).data
 def decoder_integer(self, data):
     return deserialize(factory, data, test_ttypes.Int()).data
 def decoder_bytes(self, data):
     return deserialize(factory, data, test_ttypes.Bin()).data