def test__build_easy_handle_calls__add_proxy_configuration(self, _add_proxy_configuration): """ This test simply asserts that _build_easy_handle() passes the easy_handle to _add_proxy_configuration(). """ config = DownloaderConfig() curl_downloader = HTTPCurlDownloader(config) easy_handle = curl_downloader._build_easy_handle() _add_proxy_configuration.assert_called_with(easy_handle)
def test_max_speed_unset(self): """ Assert that the max speed does not get passed to pycurl when it is not set. """ # Let's leave max_speed out of this config config = DownloaderConfig() curl_downloader = HTTPCurlDownloader(config) easy_handle = curl_downloader._build_easy_handle() # Now let's assert that MAX_RECV_SPEED_LARGE wasn't passed to setopt setopt_setting_args = [call[0][0] for call in easy_handle.setopt.call_args_list] self.assertTrue(pycurl.MAX_RECV_SPEED_LARGE not in setopt_setting_args)