def METHOD_NAME(workspace):
    doc = Document(DOC_URI, workspace, DOC)
    diags = pycodestyle_lint.pylsp_lint(workspace, doc)
    assert all(d['source'] == 'pycodestyle' for d in diags)
    # One we're expecting is:
    msg = 'W191 indentation contains tabs'
    mod_import = [d for d in diags if d['message'] == msg][0]
    assert mod_import['code'] == 'W191'
    assert mod_import['severity'] == lsp.DiagnosticSeverity.Warning
    assert mod_import['range']['start'] == {'line': 3, 'character': 0}
    assert mod_import['range']['end'] == {'line': 3, 'character': 6}
    msg = 'W391 blank line at end of file'
    mod_import = [d for d in diags if d['message'] == msg][0]
    assert mod_import['code'] == 'W391'
    assert mod_import['severity'] == lsp.DiagnosticSeverity.Warning
    assert mod_import['range']['start'] == {'line': 10, 'character': 0}
    assert mod_import['range']['end'] == {'line': 10, 'character': 1}
    msg = "E201 whitespace after '('"
    mod_import = [d for d in diags if d['message'] == msg][0]
    assert mod_import['code'] == 'E201'
    assert mod_import['severity'] == lsp.DiagnosticSeverity.Warning
    assert mod_import['range']['start'] == {'line': 2, 'character': 10}
    assert mod_import['range']['end'] == {'line': 2, 'character': 14}
    msg = "E128 continuation line under-indented for visual indent"
    mod_import = [d for d in diags if d['message'] == msg][0]
    assert mod_import['code'] == 'E128'
    assert mod_import['severity'] == lsp.DiagnosticSeverity.Warning
    assert mod_import['range']['start'] == {'line': 5, 'character': 1}
    assert mod_import['range']['end'] == {'line': 5, 'character': 10}