def testHandler_6(self): pid = self.db.insert_into('aaa',{'retry': 2, 'queue': 'task',}) tools.eq_(-2, expired.handler(self, { 'pid': pid, 'table':'aaa', })) tools.eq_({}, self.db.select_from('aaa', pid))
def testHandler_6(self): pid = self.db.insert_into('aaa', { 'retry': 2, 'queue': 'task', }) tools.eq_(-2, expired.handler(self, { 'pid': pid, 'table': 'aaa', })) tools.eq_({}, self.db.select_from('aaa', pid))
def testHandler_7(self): tools.eq_(0, self.db.redis().llen('ExpiredPool') ) pid = self.db.insert_into('aaa',{'retry': 2, 'queue':'task','timeout': 1,}) tools.eq_(None, expired.handler(self, { 'pid': pid, 'table':'aaa', })) tools.eq_( '1', self.db.select_from('aaa', pid)['retry']) time.sleep(4) #tools.eq_(1, self.db.redis().llen('ExpiredPool') ) tools.eq_('{"table": "aaa", "pid": 1}', self.db.redis().rpop('test:task') )
def testHandler_7(self): tools.eq_(0, self.db.redis().llen('ExpiredPool')) pid = self.db.insert_into('aaa', { 'retry': 2, 'queue': 'task', 'timeout': 1, }) tools.eq_(None, expired.handler(self, { 'pid': pid, 'table': 'aaa', })) tools.eq_('1', self.db.select_from('aaa', pid)['retry']) time.sleep(4) #tools.eq_(1, self.db.redis().llen('ExpiredPool') ) tools.eq_('{"table": "aaa", "pid": 1}', self.db.redis().rpop('test:task'))
def testHandler_4(self): pid = self.db.insert_into('aaa',{'hello':'world'}) tools.eq_(-2, expired.handler(self, {'pid': pid,'table':'aaa'})) tools.eq_({}, self.db.select_from('aaa', pid))
def testHandler_3(self): expired.handler(self, {'pid':1,'table':None})
def testHandler_2(self): expired.handler(None, {'pid':None,})
def testHandler_1(self): expired.handler(None, {})
def testHandler_4(self): pid = self.db.insert_into('aaa', {'hello': 'world'}) tools.eq_(-2, expired.handler(self, {'pid': pid, 'table': 'aaa'})) tools.eq_({}, self.db.select_from('aaa', pid))
def testHandler_3(self): expired.handler(self, {'pid': 1, 'table': None})
def testHandler_2(self): expired.handler(None, { 'pid': None, })