Ejemplo n.º 1
0
 def test_touch_and_exists(self):
     target = RedisTarget(HOST, PORT, DB, 'update_id', PASSWORD)
     target.marker_prefix = MARKER_PREFIX
     flush()
     self.assertFalse(target.exists(),
                      'Target should not exist before touching it')
     target.touch()
     self.assertTrue(target.exists(),
                     'Target should exist after touching it')
     flush()
Ejemplo n.º 2
0
 def test_expiration(self):
     target = RedisTarget(HOST, PORT, DB, 'update_id', PASSWORD, None,
                          EXPIRE)
     target.marker_prefix = MARKER_PREFIX
     flush()
     target.touch()
     self.assertTrue(
         target.exists(),
         'Target should exist after touching it and before expiring')
     sleep(EXPIRE)
     self.assertFalse(target.exists(),
                      'Target should not exist after expiring')
     flush()
Ejemplo n.º 3
0
 def test_touch_and_exists(self):
     target = RedisTarget(HOST, PORT, DB, 'update_id', PASSWORD)
     target.marker_prefix = MARKER_PREFIX
     flush()
     self.assertFalse(target.exists(),
                      'Target should not exist before touching it')
     target.touch()
     self.assertTrue(target.exists(),
                     'Target should exist after touching it')
     flush()
Ejemplo n.º 4
0
 def test_expiration(self):
     target = RedisTarget(
         HOST, PORT, DB, 'update_id', PASSWORD, None, EXPIRE)
     target.marker_prefix = MARKER_PREFIX
     flush()
     target.touch()
     self.assertTrue(target.exists(),
                     'Target should exist after touching it and before expiring')
     sleep(EXPIRE)
     self.assertFalse(target.exists(),
                      'Target should not exist after expiring')
     flush()