Example #1
0
 def test_decr(self):
     stat_obj = Stat('test_stat', self.resq)
     stat_obj.incr()
     stat_obj.incr()
     assert self.redis.get('resque:stat:test_stat') == str(2)
     stat_obj.decr()
     assert self.redis.get('resque:stat:test_stat') == str(1)
     stat_obj.incr()
     stat_obj.decr(2)
     assert self.redis.get('resque:stat:test_stat') == str(0)
Example #2
0
 def test_decr(self):
     stat_obj = Stat('test_stat', self.resq)
     stat_obj.incr()
     stat_obj.incr()
     assert self.redis.get('resque:stat:test_stat') == b'2'
     stat_obj.decr()
     assert self.redis.get('resque:stat:test_stat') == b'1'
     stat_obj.incr()
     stat_obj.decr(2)
     assert self.redis.get('resque:stat:test_stat') == b'0'
Example #3
0
File: tests.py Project: deepu/pyres
 def test_decr(self):
     stat_obj = Stat('test_stat', self.resq)
     stat_obj.incr()
     stat_obj.incr()
     assert self.redis.get('stat:test_stat') == 2
     stat_obj.decr()
     assert self.redis.get('stat:test_stat') == 1
     stat_obj.incr()
     stat_obj.decr(2)
     assert self.redis.get('stat:test_stat') == 0