def test_scroll_stats(self):
    self.time_mock.return_value = 1000
    self.get_http_status_mock.return_value = 200
    self.fetch('/taskqueue/v1beta2/projects/app1/taskqueues/queue1')
    self.time_mock.return_value = 2000
    self.get_http_status_mock.return_value = 200
    self.fetch('/taskqueue/v1beta2/projects/app1/taskqueues/queue1')
    self.time_mock.return_value = 3000
    self.get_http_status_mock.return_value = 200
    self.fetch('/taskqueue/v1beta2/projects/app1/taskqueues/queue1')
    self.time_mock.return_value = 99999
    raw_stats = self.fetch('/service-stats?cursor=1500000').body
    stats = json.loads(raw_stats)
    self.assertEqual(stats['cumulative_counters']['all'], 3)
    self.assertEqual(stats['recent_stats']['all'], 2)
def test_scroll_stats(self):
    self.time_mock.return_value = 1000
    self.get_http_status_mock.return_value = 200
    self.fetch('/taskqueue/v1beta2/projects/app1/taskqueues/queue1')
    self.time_mock.return_value = 2000
    self.get_http_status_mock.return_value = 200
    self.fetch('/taskqueue/v1beta2/projects/app1/taskqueues/queue1')
    self.time_mock.return_value = 3000
    self.get_http_status_mock.return_value = 200
    self.fetch('/taskqueue/v1beta2/projects/app1/taskqueues/queue1')
    self.time_mock.return_value = 99999
    raw_stats = self.fetch('/service-stats?cursor=1500000').body
    stats = json.loads(raw_stats)
    self.assertEqual(stats['cumulative_counters']['all'], 3)
    self.assertEqual(stats['recent_stats']['all'], 2)