def _TestIdRoundTrip(self, construct, deconstruct):
    """Round-trip id."""
    def _RoundTrip(device_id, device_local_id):
      server_id = construct(device_id, device_local_id)
      actual_device_id, actual_device_local_id = deconstruct(server_id)
      self.assertEqual(device_id, actual_device_id)
      self.assertEqual(device_local_id, actual_device_local_id)
      if IdTestCase._PRINT_RESULTS:
        print '%r => %s' % ((device_id, device_local_id), server_id)

    _RoundTrip(0, (0, None))
    _RoundTrip(127, (128, None))
    _RoundTrip(128, (127, None))
    _RoundTrip(128, (128, None))
    _RoundTrip(123512341234, (827348273422, None))

    _RoundTrip(0, (0, 'v1234'))
    _RoundTrip(127, (128, '\n\t\r\b\0abc123\x1000'))
    _RoundTrip(128, (127, u'1'))
    _RoundTrip(128, (128, '   '))
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/test/id_test.py/IdTestCase._TestIdRoundTrip/original