#NEWLINE# @ pytest . fixture #NEWLINE# def patched_coord( mocker , coordinator ) : #NEWLINE# #INDENT# coordinator . _subscription . subscribe ( topics = [ 'foobar' ] ) #NEWLINE# coordinator . _subscription . needs_partition_assignment = False #NEWLINE# mocker . patch . object ( coordinator , 'coordinator_unknown' , return_value = False ) #NEWLINE# coordinator . coordinator_id = 0 #NEWLINE# coordinator . generation = 0 #NEWLINE# mocker . patch . object ( coordinator , 'need_rejoin' , return_value = False ) #NEWLINE# mocker . patch . object ( coordinator . _client , 'least_loaded_node' , return_value = 1 ) #NEWLINE# mocker . patch . object ( coordinator . _client , 'ready' , return_value = True ) #NEWLINE# mocker . patch . object ( coordinator . _client , 'send' ) #NEWLINE# mocker . patch . object ( coordinator . _client , 'schedule' ) #NEWLINE# mocker . spy ( coordinator , '_failed_request' ) #NEWLINE# mocker . spy ( coordinator , '_handle_offset_commit_response' ) #NEWLINE# mocker . spy ( coordinator , '_handle_offset_fetch_response' ) #NEWLINE# mocker . spy ( coordinator . heartbeat_task , '_handle_heartbeat_success' ) #NEWLINE# mocker . spy ( coordinator . heartbeat_task , '_handle_heartbeat_failure' ) #NEWLINE# return coordinator