Beispiel #1
0
    def test_can_get_next_jobs_count(self):
        config = Config()
        config.REVIEW_EXPIRATION_IN_SECONDS = 100

        for x in range(3):
            PageFactory.create()

        next_job_list = Page.get_next_jobs_count(self.db, config)
        expect(next_job_list).to_equal(3)

        for x in range(2):
            PageFactory.create()

        next_job_list = Page.get_next_jobs_count(self.db, config)
        expect(next_job_list).to_equal(5)
Beispiel #2
0
 def increment_next_jobs_count(self, increment=1, callback=None):
     self.increment_data(
         'next-jobs',
         lambda: Page.get_next_jobs_count(self.db, self.config),
         increment,
         callback
     )
Beispiel #3
0
 def get_next_jobs_count(self, callback=None):
     self.get_data(
         'next-jobs',
         int(self.config.NEXT_JOBS_COUNT_EXPIRATION_IN_SECONDS),
         lambda: Page.get_next_jobs_count(self.db, self.config),
         callback=callback
     )
Beispiel #4
0
 def increment_next_jobs_count(self, increment=1):
     self.increment_data(
         'next-jobs',
         lambda: Page.get_next_jobs_count(self.db, self.config),
         increment
     )