Пример #1
0
 def test_clear(self):
     stat_obj = Stat('test_stat', self.resq)
     stat_obj.incr()
     stat_obj.incr()
     assert self.redis.exists('resque:stat:test_stat')
     stat_obj.clear()
     assert not self.redis.exists('resque:stat:test_stat')
Пример #2
0
 def test_clear(self):
     stat_obj = Stat('test_stat', self.resq)
     stat_obj.incr()
     stat_obj.incr()
     assert self.redis.exists('resque:stat:test_stat')
     stat_obj.clear()
     assert not self.redis.exists('resque:stat:test_stat')
Пример #3
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'
Пример #4
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)
Пример #5
0
 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
Пример #6
0
 def test_incr(self):
     stat_obj = Stat('test_stat', self.resq)
     stat_obj.incr()
     assert self.redis.get('resque:stat:test_stat') == str(1)
     stat_obj.incr()
     assert self.redis.get('resque:stat:test_stat') == str(2)
     stat_obj.incr(2)
     assert self.redis.get('resque:stat:test_stat') == str(4)
Пример #7
0
 def test_incr(self):
     stat_obj = Stat('test_stat', self.resq)
     stat_obj.incr()
     assert self.redis.get('resque:stat:test_stat') == b'1'
     stat_obj.incr()
     assert self.redis.get('resque:stat:test_stat') == b'2'
     stat_obj.incr(2)
     assert self.redis.get('resque:stat:test_stat') == b'4'
Пример #8
0
 def processed(self):
     total_processed = Stat("processed", self.resq)
     worker_processed = Stat("processed:%s" % str(self), self.resq)
     total_processed.incr()
     worker_processed.incr()
Пример #9
0
 def test_get(self):
     stat_obj = Stat('test_stat', self.resq)
     stat_obj.incr()
     stat_obj.incr()
     assert stat_obj.get() == 2
Пример #10
0
 def processed(self):
     total_processed = Stat("processed", self.resq)
     worker_processed = Stat("processed:%s" % str(self), self.resq)
     total_processed.incr()
     worker_processed.incr()
Пример #11
0
 def test_get(self):
     stat_obj = Stat('test_stat', self.resq)
     stat_obj.incr()
     stat_obj.incr()
     assert stat_obj.get() == 2
Пример #12
0
 def failed(self):
     total_failed = Stat("failed", self.resq)
     stat = Stat("failed:%s" % self, self.resq)
     total_failed.incr()
     stat.incr()
Пример #13
0
 def processed(self):
     total_processed = Stat("processed", self.resq)
     total_processed.incr()
Пример #14
0
 def processed(self):
     total_processed = Stat("processed", self.resq)
     total_processed.incr()