def METHOD_NAME(make_stubber, error_code):
    comprehend_client = boto3.client('comprehend')
    comprehend_stubber = make_stubber(comprehend_client)
    comp_detect = ComprehendDetect(comprehend_client)
    text = 'test-text'
    language = 'fr'
    tokens = [{
        'TokenId': index,
        'Text': f'test-{index}',
        'BeginOffset': index,
        'EndOffset': index * 2,
        'PartOfSpeech': {'Tag': 'TEST', 'Score': index}
    } for index in range(5)]
    comprehend_stubber.stub_detect_syntax(
        text, language, tokens, error_code=error_code)
    if error_code is None:
        got_tokens = comp_detect.detect_syntax(text, language)
        assert got_tokens == tokens
    else:
        with pytest.raises(ClientError) as exc_info:
            comp_detect.detect_syntax(text, language)
        assert exc_info.value.response['Error']['Code'] == error_code