def test_serialization(self):
        for data_type in Type.__subclasses__():
            if data_type in TEST_DATA:
                test_cases = TEST_DATA[data_type]

                for test_data in test_cases:
                    packet_buffer = PacketBuffer()
                    data_type.send(test_data, packet_buffer)
                    packet_buffer.reset_cursor()

                    deserialized = data_type.read(packet_buffer)
                    if data_type is Float or data_type is Double:
                        self.assertAlmostEquals(test_data, deserialized, 3)
                    else:
                        self.assertEqual(test_data, deserialized)
dataset/ETHPy150Open ammaraskar/pyCraft/tests/test_serialization.py/SerializationTest.test_serialization/original