<s> """<STR_LIT>""" <EOL> import mock <EOL> import pytest <EOL> from requests_toolbelt . _compat import queue <EOL> from requests_toolbelt import threaded <EOL> def test_creates_a_pool_for_the_user ( ) : <EOL> """<STR_LIT>""" <EOL> mocked_pool = mock . Mock ( spec = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> with mock . patch ( '<STR_LIT>' ) as Pool : <EOL> Pool . return_value = mocked_pool <EOL> threaded . map ( [ { } , { } ] ) <EOL> assert Pool . called is True <EOL> _ , kwargs = Pool . call_args <EOL> assert '<STR_LIT>' in kwargs <EOL> assert isinstance ( kwargs [ '<STR_LIT>' ] , queue . Queue ) <EOL> mocked_pool . join_all . assert_called_once_with ( ) <EOL> mocked_pool . responses . assert_called_once_with ( ) <EOL> mocked_pool . exceptions . assert_called_once_with ( ) <EOL> def test_raises_a_value_error_for_non_dictionaries ( ) : <EOL> """<STR_LIT>""" <EOL> with pytest . raises ( ValueError ) : <EOL> threaded . map ( [ [ ] , [ ] ] ) <EOL> def test_raises_a_value_error_for_falsey_requests ( ) : <EOL> """<STR_LIT>""" <EOL> with pytest . raises ( ValueError ) : <EOL> threaded . map ( [ ] ) <EOL> with pytest . raises ( ValueError ) : <EOL> threaded . map ( None ) <EOL> def test_passes_on_kwargs ( ) : <EOL> """<STR_LIT>""" <EOL> mocked_pool = mock . Mock ( spec = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> with mock . patch ( '<STR_LIT>' ) as Pool : <EOL> Pool . return_value = mocked_pool <EOL> threaded . map ( [ { } , { } ] , num_processes = <NUM_LIT:1000> , <EOL> initializer = test_passes_on_kwargs ) <EOL> _ , kwargs = Pool . call_args <EOL> assert '<STR_LIT>' in kwargs <EOL> assert '<STR_LIT>' in kwargs <EOL> assert '<STR_LIT>' in kwargs <EOL> assert kwargs [ '<STR_LIT>' ] == <NUM_LIT:1000> <EOL> assert kwargs [ '<STR_LIT>' ] == test_passes_on_kwargs </s>
