#NEWLINE# @ pytest . mark . parametrize ( 'response,error,dead,reassign' , [ ( OffsetCommitResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 30 ) , ( 1 , 30 ) ] ) ] ) , Errors . GroupAuthorizationFailedError , False , False ) , ( OffsetCommitResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 12 ) , ( 1 , 12 ) ] ) ] ) , Errors . OffsetMetadataTooLargeError , False , False ) , ( OffsetCommitResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 28 ) , ( 1 , 28 ) ] ) ] ) , Errors . InvalidCommitOffsetSizeError , False , False ) , ( OffsetCommitResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 14 ) , ( 1 , 14 ) ] ) ] ) , Errors . GroupLoadInProgressError , False , False ) , ( OffsetCommitResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 15 ) , ( 1 , 15 ) ] ) ] ) , Errors . GroupCoordinatorNotAvailableError , True , False ) , ( OffsetCommitResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 16 ) , ( 1 , 16 ) ] ) ] ) , Errors . NotCoordinatorForGroupError , True , False ) , ( OffsetCommitResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 7 ) , ( 1 , 7 ) ] ) ] ) , Errors . RequestTimedOutError , True , False ) , ( OffsetCommitResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 25 ) , ( 1 , 25 ) ] ) ] ) , Errors . CommitFailedError , False , True ) , ( OffsetCommitResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 22 ) , ( 1 , 22 ) ] ) ] ) , Errors . CommitFailedError , False , True ) , ( OffsetCommitResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 27 ) , ( 1 , 27 ) ] ) ] ) , Errors . CommitFailedError , False , True ) , ( OffsetCommitResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 17 ) , ( 1 , 17 ) ] ) ] ) , Errors . InvalidTopicError , False , False ) , ( OffsetCommitResponse [ 0 ] ( [ ( 'foobar' , [ ( 0 , 29 ) , ( 1 , 29 ) ] ) ] ) , Errors . TopicAuthorizationFailedError , False , False ) ] ) #NEWLINE# def test_handle_offset_commit_response( mocker , patched_coord , offsets , response , error , dead , reassign ) : #NEWLINE# #INDENT# future = Future ( ) #NEWLINE# patched_coord . _handle_offset_commit_response ( offsets , future , time . time ( ) , response ) #NEWLINE# assert isinstance ( future . exception , error ) #NEWLINE# assert ( patched_coord . coordinator_id is ( None if dead else 0 ) ) #NEWLINE# assert ( patched_coord . _subscription . needs_partition_assignment is reassign )