#NEWLINE# @ patch ( 'pybuilder.pluginloader._load_plugin' ) #NEWLINE# @ patch ( 'pybuilder.pluginloader._install_external_plugin' ) #NEWLINE# def test_should_not_load_module_twice_after_downloading_when_pypi_download_fails( self , install , load ) : #NEWLINE# #INDENT# install . side_effect = MissingPluginException ( 'PyPI Install Boom' ) #NEWLINE# load . side_effect = MissingPluginException ( 'PyPI Load Boom' ) #NEWLINE# downloader = DownloadingPluginLoader ( Mock ( ) ) #NEWLINE# self . assertRaises ( MissingPluginException , downloader . load_plugin , Mock ( ) , 'pypi:external_plugin' ) #NEWLINE# self . assertEquals ( load . call_count , 1 )