update test

This commit is contained in:
holys 2014-08-11 10:10:36 +08:00
parent a985e3ff08
commit 5ce968006c
1 changed files with 3 additions and 9 deletions

View File

@ -120,18 +120,12 @@ def ledis_ttl(ledis_client, key, k_type):
def test_ttl():
keys, total = scan(rds, 1000)
invalid = []
for key in keys:
k_type = rds.type(key)
rds.expire(key, 100)
rds.expire(key, (60 * 60 * 24))
set_ttl(rds, lds, key, k_type)
# if rds.ttl(key) != ledis_ttl(lds, key, k_type):
# print key
# print rds.ttl(key)
# print ledis_ttl(lds, key, k_type)
# invalid.append(key)
assert rds.ttl(key) == ledis_ttl(lds, key, k_type)
if rds.ttl(key):
assert ledis_ttl(lds, key, k_type) > 0
if __name__ == "__main__":
test()