#NEWLINE# def do_fetch( self , import_path , expected_url , rev = None ) : #NEWLINE# #INDENT# with subsystem_instance ( ArchiveFetcher ) as fetcher : #NEWLINE# #INDENT# fetcher . _fetch = mock . MagicMock ( spec = dest . _fetch ) #NEWLINE# with temporary_dir ( ) as dest : #NEWLINE# #INDENT# fetcher . fetch ( import_path , dest , rev = rev ) #NEWLINE# #UNINDENT# self . assertEqual ( 1 , fetcher . _fetch . call_count ) #NEWLINE# self . assertEqual ( mock . call ( expected_url ) , fetcher . _fetch . call_args )