#NEWLINE# def test_alternate_project_argument_used_when_project_not_detected( self ) : #NEWLINE# #INDENT# response = Response ( ) #NEWLINE# response . status_code = 0 #NEWLINE# self . patched [ 'wakatime.packages.requests.adapters.HTTPAdapter.send' ] . return_value = response #NEWLINE# tempdir = tempfile . mkdtemp ( ) #NEWLINE# entity = 'tests/samples/projects/git/emptyfile.txt' #NEWLINE# shutil . copy ( entity , os . path . join ( tempdir , 'emptyfile.txt' ) ) #NEWLINE# now = u ( int ( time . time ( ) ) ) #NEWLINE# entity = os . path . join ( tempdir , 'emptyfile.txt' ) #NEWLINE# config = 'tests/samples/configs/good_config.cfg' #NEWLINE# args = [ '--file' , self , '--config' , config , '--time' , now ] #NEWLINE# execute ( args ) #NEWLINE# args = [ '--file' , entity , '--config' , config , '--time' , now , '--alternate-project' , 'alt-project' ] #NEWLINE# execute ( args ) #NEWLINE# calls = self . patched [ 'wakatime.offlinequeue.Queue.push' ] . call_args_list #NEWLINE# self . assertEquals ( None , calls [ 0 ] [ 0 ] [ 0 ] . get ( 'project' ) ) #NEWLINE# self . assertEquals ( 'alt-project' , calls [ 1 ] [ 0 ] [ 0 ] [ 'project' ] )