#NEWLINE# def test_update_req_sha_and_queue_pickme_pickme_test_pickme_conflict( self ) : #NEWLINE# #INDENT# new_sha = ( '1' * 40 ) #NEWLINE# pickme_request = copy . deepcopy ( self . fake_request ) #NEWLINE# pickme_request [ 'state' ] = 'pickme' #NEWLINE# pickme_request [ 'tags' ] = 'no-conflicts' #NEWLINE# with mock . patch ( 'pushmanager.core.git.GitQueue.enqueue_request' ) as enqueue_req : #NEWLINE# #INDENT# with mock . patch . dict ( Settings , MockedSettings ) : #NEWLINE# #INDENT# GitQueue . _update_req_sha_and_queue_pickme ( pickme_request , new_sha ) #NEWLINE# result = [ None ] #NEWLINE# def on_db_return( success , db_results ) : #NEWLINE# #INDENT# assert success , 'Database error' #NEWLINE# result [ 0 ] = db_results . first ( ) #NEWLINE# #UNINDENT# request_info_query = db . push_requests . select ( ) . where ( ( db . push_requests . c . id == self . fake_request [ 'id' ] ) ) #NEWLINE# db . execute_cb ( request_info_query , on_db_return ) #NEWLINE# T . assert_equal ( result [ 0 ] [ 5 ] , new_sha ) #NEWLINE# T . assert_equals ( enqueue_req . call_count , 2 ) #NEWLINE# enqueue_req . assert_has_calls ( [ mock . call ( GitTaskAction . TEST_PICKME_CONFLICT , 1 , pushmanager_url = ( 'https://%s:%s' % ( MockedSettings [ 'main_app' ] [ 'servername' ] , MockedSettings [ 'main_app' ] [ 'port' ] ) ) ) ] )