def test_parse_line_with_context(monkeypatch, word, bounds, workspace): doc = Document(DOC_URI, workspace) monkeypatch.setattr(Document, 'word_at_position', lambda *args: word) diag = plugin.parse_line(TEST_LINE, doc) assert diag['message'] == '"Request" has no attribute "id"' assert diag['range']['start'] == {'line': 278, 'character': bounds[0]} assert diag['range']['end'] == {'line': 278, 'character': bounds[1]}
def test_parse_line_with_context(monkeypatch, word, bounds, workspace): doc = Document(DOC_URI, workspace) monkeypatch.setattr(Document, "word_at_position", lambda *args: word) diag = plugin.parse_line(TEST_LINE, doc) assert diag["message"] == '"Request" has no attribute "id"' assert diag["range"]["start"] == {"line": 278, "character": bounds[0]} assert diag["range"]["end"] == {"line": 278, "character": bounds[1]}
def test_parse_line_without_line(workspace): doc = Document(DOC_URI, workspace) diag = plugin.parse_line(TEST_LINE_WITHOUT_LINE, doc) assert diag['message'] == '"Request" has no attribute "id"' assert diag['range']['start'] == {'line': 0, 'character': 0} assert diag['range']['end'] == {'line': 0, 'character': 6}
def test_parse_full_line(workspace): doc = Document(DOC_URI, workspace) diag = plugin.parse_line(TEST_LINE, doc) assert diag['message'] == '"Request" has no attribute "id"' assert diag['range']['start'] == {'line': 278, 'character': 7} assert diag['range']['end'] == {'line': 278, 'character': 8}
def test_parse_line_without_line(workspace): doc = Document(DOC_URI, workspace) diag = plugin.parse_line(TEST_LINE_WITHOUT_LINE, doc) assert diag["message"] == '"Request" has no attribute "id"' assert diag["range"]["start"] == {"line": 0, "character": 0} assert diag["range"]["end"] == {"line": 0, "character": 6}
def test_parse_full_line(workspace): doc = Document(DOC_URI, workspace) diag = plugin.parse_line(TEST_LINE, doc) assert diag["message"] == '"Request" has no attribute "id"' assert diag["range"]["start"] == {"line": 278, "character": 7} assert diag["range"]["end"] == {"line": 278, "character": 8}