summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Reifschneider <jafo@tummy.com>2011-11-27 17:56:58 -0700
committerSean Reifschneider <jafo@tummy.com>2011-11-27 17:56:58 -0700
commite9e5abd0ffec136450a08f31e3e1b44a793de40c (patch)
tree50d297288c103b2131300d5cbddd3d21a87257be
parent25bf14164158e97a045239b7681c3d508a2aa17c (diff)
downloadpython-memcached-e9e5abd0ffec136450a08f31e3e1b44a793de40c.tar.gz
Adding commented-out timed delete test.
-rw-r--r--memcache.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/memcache.py b/memcache.py
index 9a50407..674ee33 100644
--- a/memcache.py
+++ b/memcache.py
@@ -410,7 +410,7 @@ class Client(local):
@return: Nonzero on success.
@param time: number of seconds any subsequent set / update commands
- should fail. Defaults to 0 for no delay.
+ should fail. Defaults to None for no delay.
@rtype: int
'''
self.check_key(key)
@@ -418,7 +418,7 @@ class Client(local):
if not server:
return 0
self._statlog('delete')
- if time != None:
+ if time != None and time != 0:
cmd = "delete %s %d" % (key, time)
else:
cmd = "delete %s" % key
@@ -1220,6 +1220,19 @@ if __name__ == "__main__":
print "Testing get_multi ...",
print mc.get_multi(["a_string", "an_integer"])
+ # removed from the protocol
+ #if test_setget("timed_delete", 'foo'):
+ # print "Testing timed delete ...",
+ # if mc.delete("timed_delete", 1):
+ # print "OK"
+ # else:
+ # print "FAIL"; failures = failures + 1
+ # print "Checking results of timed delete ..."
+ # if mc.get("timed_delete") == None:
+ # print "OK"
+ # else:
+ # print "FAIL"; failures = failures + 1
+
print "Testing get(unknown value) ...",
print to_s(mc.get("unknown_value"))