#NEWLINE# @ mock . patch ( 'olympia.devhub.utils.chain' ) #NEWLINE# def test_run_once_file_upload( self , chain ) : #NEWLINE# #INDENT# 'Tests that only a single validation task is run for a given file\n        upload.' #NEWLINE# task = mock . Mock ( ) #NEWLINE# chain . return_value = task #NEWLINE# task . delay . return_value = mock . Mock ( task_id = '42' ) #NEWLINE# assert isinstance ( tasks . validate ( self . file_upload ) , mock . Mock ) #NEWLINE# assert ( task . delay . call_count == 1 ) #NEWLINE# assert isinstance ( tasks . validate ( self . file_upload ) , AsyncResult ) #NEWLINE# assert ( task . delay . call_count == 1 )