コード例 #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()
コード例 #2
0
ファイル: redis_test.py プロジェクト: PeteW/luigi
 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()
コード例 #3
0
ファイル: redis_test.py プロジェクト: PeteW/luigi
 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()
コード例 #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()