def test_do_submit(self): bt = BaseThrottler(delay=self.default_delay) bt.start() throttled_request = bt._submit(self.default_request) self.assertIsInstance(throttled_request, ThrottledRequest) bt.shutdown() with BaseThrottler(delay=self.default_delay) as bt: throttled_request = bt._submit(self.default_request) self.assertIsInstance(throttled_request, ThrottledRequest)
def test_do_submit(self): bt = BaseThrottler(delay=self.default_delay) bt.start() throttled_request = bt._submit(self.default_request) self.assertIsInstance(throttled_request, ThrottledRequest) bt.shutdown() with BaseThrottler(delay=self.default_delay) as bt: throttled_request = bt._submit(self.default_request) self.assertIsInstance(throttled_request, ThrottledRequest)
def test_submit(self): bt = BaseThrottler(delay=self.default_delay) bt.start() throttled_request = bt.submit(self.default_request) self.assertIsInstance(throttled_request, ThrottledRequest) reqs = [self.default_request for i in range(0, 10)] throttled_requests = bt.multi_submit(reqs) self.assertIsInstance(throttled_requests, list) self.assertEqual(10, len(throttled_requests)) bt.shutdown() with BaseThrottler(delay=self.default_delay) as bt: throttled_request = bt.submit(self.default_request) self.assertIsInstance(throttled_request, ThrottledRequest) reqs = [self.default_request for i in range(0, 10)] throttled_requests = bt.multi_submit(reqs) self.assertIsInstance(throttled_requests, list) self.assertEqual(10, len(throttled_requests))
def test_submit(self): bt = BaseThrottler(delay=self.default_delay) bt.start() throttled_request = bt.submit(self.default_request) self.assertIsInstance(throttled_request, ThrottledRequest) reqs = [self.default_request for i in range(0, 10)] throttled_requests = bt.multi_submit(reqs) self.assertIsInstance(throttled_requests, list) self.assertEqual(10, len(throttled_requests)) bt.shutdown() with BaseThrottler(delay=self.default_delay) as bt: throttled_request = bt.submit(self.default_request) self.assertIsInstance(throttled_request, ThrottledRequest) reqs = [self.default_request for i in range(0, 10)] throttled_requests = bt.multi_submit(reqs) self.assertIsInstance(throttled_requests, list) self.assertEqual(10, len(throttled_requests))