def _TestIdRoundTripWithTimestamp(self, construct, deconstruct):
    """Round-trip id with a timestamp."""
    def _RoundTrip(timestamp, device_id, uniquifier):
      asset_id = construct(timestamp, device_id, uniquifier)
      actual_timestamp, actual_device_id, actual_uniquifier = \
          deconstruct(asset_id)
      self.assertEqual(int(timestamp), actual_timestamp)
      self.assertEqual(device_id, actual_device_id)
      self.assertEqual(uniquifier, actual_uniquifier)
      if IdTestCase._PRINT_RESULTS:
        print '%r => %s' % ((timestamp, device_id, uniquifier), asset_id)

    _RoundTrip(0, 0, (0, None))
    _RoundTrip(1234234.123423, 127, (128, None))
    _RoundTrip(time.time(), 128, (127, None))
    _RoundTrip(time.time(), 128, (128, None))
    _RoundTrip(time.time(), 123512341234, (827348273422, None))

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