Permalink
Browse files

Merge remote-tracking branch 'jdavisp3/unwatch-fix-2011-06-04'

  • Loading branch information...
2 parents 0a5b45f + ce63b0b commit 2e5e1dbcd609a2e0e9721e260d74181ec8614396 @rlotun rlotun committed Jul 8, 2011
Showing with 14 additions and 2 deletions.
  1. +2 −2 txredis/protocol.py
  2. +12 −0 txredis/test/test_redis.py
View
@@ -609,11 +609,11 @@ def watch(self, *keys):
self._send('WATCH', *keys)
return self.getResponse()
- def unwatch(self, *keys):
+ def unwatch(self):
"""
Forget about all watched keys
"""
- self._send('UNWATCH', *keys)
+ self._send('UNWATCH')
return self.getResponse()
@@ -469,6 +469,18 @@ def got_it(res):
d.addCallback(step1)
return d
+ @defer.inlineCallbacks
+ def test_watch(self):
+ r = yield self.redis.watch('foo')
+ self.assertEqual(r, 'OK')
+
+ @defer.inlineCallbacks
+ def test_unwatch(self):
+ yield self.redis.watch('foo')
+ r = yield self.redis.unwatch()
+ self.assertEqual(r, 'OK')
+
+
class Strings(CommandsTestBase):
"""Test commands that operate on string values.
"""

0 comments on commit 2e5e1db

Please sign in to comment.