#NEWLINE# @ pytest . mark . parametrize ( 'response,error,dead,reassign' , [ ( OffsetFetchResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 123 , b'' , 14 ) , ( 1 , 234 , b'' , 14 ) ] ) ] ) , Errors . GroupLoadInProgressError , False , False ) , ( OffsetFetchResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 123 , b'' , 16 ) , ( 1 , 234 , b'' , 16 ) ] ) ] ) , Errors . NotCoordinatorForGroupError , True , False ) , ( OffsetFetchResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 123 , b'' , 25 ) , ( 1 , 234 , b'' , 25 ) ] ) ] ) , Errors . UnknownMemberIdError , False , True ) , ( OffsetFetchResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 123 , b'' , 22 ) , ( 1 , 234 , b'' , 22 ) ] ) ] ) , Errors . IllegalGenerationError , False , True ) , ( OffsetFetchResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 123 , b'' , 29 ) , ( 1 , 234 , b'' , 29 ) ] ) ] ) , Errors . TopicAuthorizationFailedError , False , False ) , ( OffsetFetchResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 123 , b'' , 0 ) , ( 1 , 234 , b'' , 0 ) ] ) ] ) , None , False , False ) ] ) #NEWLINE# def test_handle_offset_fetch_response( patched_coord , offsets , response , error , dead , reassign ) : #NEWLINE# #INDENT# future = Future ( ) #NEWLINE# patched_coord . _handle_offset_fetch_response ( error , response ) #NEWLINE# if ( error is not None ) : #NEWLINE# #INDENT# assert isinstance ( future . exception , error ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert future . succeeded ( ) #NEWLINE# assert ( future . value == offsets ) #NEWLINE# #UNINDENT# assert ( patched_coord . coordinator_id is ( None if dead else 0 ) ) #NEWLINE# assert ( patched_coord . _subscription . needs_partition_assignment is reassign )