def test_get_set(self):
        now = int(time.time())
        key = str(uuid.uuid4().hex)[:5]
        val = {'foo': 1}
        self.tik.set(key, val, timestamp=now, update_index=True)
        val1, t1 = self.tik.get(key)
        val2, t2 = self.tik[key]
        self.assertEqual(now, t1, t2)
        self.assertEqual(val, val1, val2)

        val = {'bar': 2}
        past = 10 - now
        self.tik.set(key, val, timestamp=past, update_index=False)
        val1, t1 = self.tik.get(key)
        val2, t2 = self.tik[key]
        self.assertEqual(now, t1, t2)
        self.assertEqual(val, val1, val2)

        val = {'baz': 3}
        self.tik.set(key, val, timestamp=past, update_index=True)
        val1, t1 = self.tik.get(key)
        val2, t2 = self.tik[key]
        self.assertEqual(past, t1, t2)
        self.assertEqual(val, val1, val2)

        self.tik[key] = val = {'abc': 4}
        val1, t1 = self.tik.get(key)
        val2, t2 = self.tik[key]
        self.assertNotEqual(t1, past, now)
        self.assertEqual(t1, t2)
        self.assertEqual(val, val1, val2)
dataset/ETHPy150Open caxap/redis-moment/moment/tests.py/TimeIndexedKeyTestCase.test_get_set/swapped operands of `-`