File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,25 @@ def test_type(self):
213
213
self .client .zadd ('a' , '1' , 1 )
214
214
self .assertEquals (self .client .type ('a' ), 'zset' )
215
215
216
+ def test_watch (self ):
217
+ self .client .set ("a" , 1 )
218
+
219
+ self .client .watch ("a" )
220
+ pipeline = self .client .pipeline ()
221
+ pipeline .set ("a" , 2 )
222
+ self .assertEquals (pipeline .execute (), [True ])
223
+
224
+ self .client .set ("b" , 1 )
225
+ self .client .watch ("b" )
226
+ self .get_client ().set ("b" , 2 )
227
+ pipeline = self .client .pipeline ()
228
+ pipeline .set ("b" , 3 )
229
+
230
+ self .assertRaises (redis .exceptions .WatchError , pipeline .execute )
231
+
232
+ def test_unwatch (self ):
233
+ self .assertEquals (self .client .unwatch (), True )
234
+
216
235
# LISTS
217
236
def make_list (self , name , l ):
218
237
for i in l :
You can’t perform that action at this time.
0 commit comments