def test_summary_countstart(self):
        # push more than 5 jobs into same queue
        N = 6
        jobq = self.project.jobq
        for state in ('pending', 'running', 'finished'):
            for idx in xrange(N):
                jobq.push(self.spidername, state=state, idx=idx)

            s1 = jobq.summary(state)
            self.assertEqual(s1['count'], N)
            self.assertEqual(len(s1['summary']), 5)

            s2 = jobq.summary(state, count=N)
            self.assertEqual(len(s2['summary']), N)

            s3 = jobq.summary(state, start=N - 6, count=3)
            self.assertEqual([o['key'] for o in s3['summary']],
                             [o['key'] for o in s2['summary'][-6:-3]])
dataset/ETHPy150Open scrapinghub/python-hubstorage/tests/test_jobq.py/JobqTest.test_summary_countstart/original