def test_multiprocessor(self): urls = [ 'Url #1', 'Url #2', 'Url #3', ] get_all = GetAll(self.company) get_all._urls = urls get_all._multiprocessing_badges() self.MockThreadPoolExecutor_map.assert_called_once_with( get_all._request_urls, get_all._urls)
def test_multiprocessor_when_max_workers_is_less_than_badges(self): urls = [ '', '', '', '', '', ] expected_workers = 2 get_all = GetAll(self.company) get_all._max_workers = expected_workers get_all._urls = urls get_all._multiprocessing_badges() self.MockThreadPoolExecutor.assert_called_once_with(expected_workers)