repo
stringclasses
454 values
file_path
stringlengths
5
201
extension
stringclasses
1 value
content
stringlengths
8
509k
num_lines
int64
3
16.9k
size_bytes
int64
8
511k
serena
test/solidlsp/rust/test_rust_analyzer_settings.py
.py
from contextlib import nullcontext from typing import Any, cast from unittest.mock import MagicMock import pytest from solidlsp import SolidLanguageServer from solidlsp.language_servers.rust_analyzer import RustAnalyzer pytestmark = pytest.mark.rust def _make_server() -> RustAnalyzer: return object.__new__(Rus...
50
2,048
serena
test/solidlsp/rust/test_rust_basic.py
.py
import os import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_utils import SymbolUtils from test.conftest import find_identifier_position, get_repo_path, ls_has_verified_implementation_support from test.solidlsp.conftest import format_symbol_for_asse...
100
5,845
serena
test/solidlsp/rust/test_rust_analyzer_detection.py
.py
""" Tests for rust-analyzer detection logic. These tests describe the expected behavior of RustAnalyzer._ensure_rust_analyzer_installed(): 1. Rustup should be checked FIRST (avoids picking up incorrect PATH aliases) 2. Common installation locations (Homebrew, cargo, Scoop) should be checked as fallback 3. System PATH...
562
27,435
serena
test/solidlsp/rust/test_rust_2024_edition.py
.py
import os from collections.abc import Iterator from pathlib import Path import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_utils import SymbolUtils from test.conftest import start_ls_context @pytest.fixture(scope="class") def rust_language_server(...
112
6,063
serena
test/solidlsp/erlang/test_erlang_symbol_names.py
.py
"""Normalization of Erlang's ``name/arity`` symbol identifiers. Reproduces https://github.com/oraios/serena/issues/1797: Erlang LS names functions, types and parameterised macros ``name/arity`` (e.g. ``create_user/4``), but ``/`` separates the components of a Serena name path. Such a name was therefore parsed as "symb...
106
5,768
serena
test/solidlsp/erlang/__init__.py
.py
import platform def _test_erlang_ls_available() -> str: """Test if Erlang LS is available and return error reason if not.""" # Check if we're on Windows (Erlang LS doesn't support Windows) if platform.system() == "Windows": return "Erlang LS does not support Windows" # Try to import and check...
34
1,277
serena
test/solidlsp/erlang/test_erlang_ignored_dirs.py
.py
from collections.abc import Generator from pathlib import Path import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.conftest import language_server_tests_enabled, start_ls_context # These marks will be applied to all tests in this module pytestmark = [ ...
199
10,951
serena
test/solidlsp/erlang/test_erlang_basic.py
.py
""" Basic integration tests for the Erlang language server functionality. These tests validate the functionality of the language server APIs like request_references using the test repository. """ import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.conftest...
67
2,870
serena
test/solidlsp/erlang/test_erlang_symbol_retrieval.py
.py
""" Tests for the Erlang language server symbol-related functionality. These tests focus on the following methods: - request_containing_symbol - request_referencing_symbols - request_defining_symbol """ import os import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId ...
444
21,504
serena
test/solidlsp/erlang/conftest.py
.py
""" Erlang-specific test configuration and fixtures. """ import os import subprocess import time from pathlib import Path import pytest def ensure_erlang_test_repo_compiled(repo_path: str) -> None: """Ensure the Erlang test repository dependencies are installed and project is compiled. Erlang LS requires t...
175
6,440
serena
test/solidlsp/angular/test_angular_basic.py
.py
""" Basic integration tests for the Angular language server. The Angular LS understands Angular template syntax (*ngIf, [prop], (event), {{ interpolation }}, @if/@for blocks) and provides type-aware navigation between templates and component classes. Workspace: a minimal standalone-component Angular app with a servic...
345
20,928
serena
test/solidlsp/angular/test_angular_diagnostics.py
.py
""" Diagnostics tests for the Angular language server. Two paths are exercised: * .ts component — tsserver (via the @angular/language-service plugin) reports the type-mismatch on a class field initializer. * .html template — ngserver reports the unresolved identifier in a template interpolation, but only b...
45
1,762
serena
test/solidlsp/angular/test_angular_error_cases.py
.py
""" Error / edge-case tests for the Angular language server. The Angular LS routes by file extension across three child processes: * ``ngserver`` for ``.html`` definition / references / hover * companion ``typescript-language-server`` (with @angular/language-service loaded as a tsserver plugin) for ``.ts...
370
19,651
serena
test/solidlsp/angular/conftest.py
.py
""" Pytest fixtures for Angular language server tests. This conftest is NOT installing the language server itself — that is fully handled by ``RuntimeDependencyCollection`` inside ``AngularLanguageServer`` and lands in Serena's managed ``ls_resources_dir`` like every other LS download. What we install here is the *te...
89
3,926
serena
test/solidlsp/java/test_jdtls_path_resolution.py
.py
""" Unit tests for the offline (upstream) JDTLS resolution helpers in ``solidlsp.language_servers.eclipse_jdtls``. These tests cover only the path/version/validation logic; they do not start JDTLS and do not require Java to be installed. Subprocess interactions are mocked. """ from __future__ import annotations impo...
772
37,600
serena
test/solidlsp/java/test_java_diagnostics.py
.py
import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.solidlsp.util.diagnostics import assert_file_diagnostics @pytest.mark.java class TestJavaDiagnostics: @pytest.mark.parametrize("language_server", [LanguageServerId.JAVA], indirect=True) def test_f...
18
564
serena
test/solidlsp/java/test_java_basic.py
.py
import os import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_utils import SymbolUtils from test.conftest import ( find_identifier_position, get_repo_path, language_server_tests_enabled, ls_has_verified_implementation_support, ) from ...
151
9,291
serena
test/solidlsp/python/test_basedpyright.py
.py
from collections.abc import Iterator from pathlib import Path from textwrap import dedent import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.conftest import start_ls_context from test.solidlsp.conftest import document_symbol_names pytestmark = pytest.mark...
99
3,646
serena
test/solidlsp/python/test_retrieval_with_ignored_dirs.py
.py
from collections.abc import Generator from pathlib import Path import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.conftest import start_ls_context from test.solidlsp.conftest import PYTHON_BACKEND_LANGUAGES # This mark will be applied to all tests in this...
64
2,811
serena
test/solidlsp/python/test_python_diagnostics.py
.py
import os import pytest from solidlsp import SolidLanguageServer from test.conftest import PYTHON_LANGUAGE_BACKENDS from test.solidlsp.util.diagnostics import assert_file_diagnostics @pytest.mark.python class TestPythonDiagnostics: @pytest.mark.parametrize("language_server", PYTHON_LANGUAGE_BACKENDS, indirect=T...
20
617
serena
test/solidlsp/python/test_basedpyright_server.py
.py
from pathlib import Path from unittest.mock import Mock, patch import pytest from solidlsp.dependency_provider import LanguageServerDependencyProviderUvx from solidlsp.language_servers.basedpyright_server import BASEDPYRIGHT_VERSION, BasedPyrightLanguageServer from solidlsp.language_servers.pyright_server import Pyri...
142
5,065
serena
test/solidlsp/python/test_python_basic.py
.py
""" Basic integration tests for the language server functionality. These tests validate the functionality of the language server APIs like request_references using the test repository. """ import os import pytest from serena.project import Project from serena.util.text_utils import LineType from solidlsp import Sol...
270
16,458
serena
test/solidlsp/python/test_symbol_retrieval.py
.py
""" Tests for the language server symbol-related functionality. These tests focus on the following methods: - request_containing_symbol - request_referencing_symbols """ import os import pytest from serena.symbol import LanguageServerSymbol from serena.util.text_utils import find_text_coordinates from solidlsp impo...
413
23,653
serena
test/solidlsp/cpp/test_cpp_unreal_unit.py
.py
"""Unreal Engine handling in the clangd and ccls servers, without starting a process. No ``cpp`` marker: these build server shells with ``object.__new__`` and call the no-database and directory-ignore code paths directly, so they run in the default suite. """ import pytest from solidlsp.language_servers.ccls_languag...
76
2,783
serena
test/solidlsp/cpp/test_clangd_languages.py
.py
import os import pytest from solidlsp.ls_config import LanguageServerId from test.conftest import start_ls_context @pytest.mark.cpp class TestClangdLanguages: @pytest.mark.parametrize( "lang, unit, names", [ ("C", "a.c", {"main"}), ("CUDA", "a.cu", {"main", "cuda_hello"})...
31
1,181
serena
test/solidlsp/cpp/test_ccls_languages.py
.py
import os import pytest from solidlsp.ls_config import LanguageServerId from test.conftest import start_ls_context @pytest.mark.cpp class TestCCLSLanguages: @pytest.mark.parametrize( "lang, unit, names", [ ("C", "a.c", {"main"}), ("Objective-C", "a.m", {"main", "Hello", "...
25
867
serena
test/solidlsp/cpp/test_cpp_diagnostics.py
.py
import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.solidlsp.util.diagnostics import assert_file_diagnostics @pytest.mark.cpp class TestCppDiagnostics: @pytest.mark.parametrize("language_server", [LanguageServerId.CPP], indirect=True) def test_file...
18
537
serena
test/solidlsp/cpp/test_clangd_logging.py
.py
import logging import pytest from solidlsp import SolidLanguageServer from solidlsp.language_servers.clangd_language_server import ClangdLanguageServer @pytest.mark.cpp class TestClangdLogging: @pytest.mark.parametrize( "expected, line", [ # Parametrize names instead of codes for hum...
44
2,064
serena
test/solidlsp/cpp/test_cpp_unreal.py
.py
""" Unreal Engine 5 fixture tests for the clangd language server. UE game code is written against a macro-based reflection layer (UCLASS, UFUNCTION, UPROPERTY, GENERATED_BODY) and engine container types (TArray, TMap). These tests verify that the clangd backend resolves symbols, references, definitions, and rename edi...
188
11,764
serena
test/solidlsp/cpp/test_cpp_basic.py
.py
""" Basic tests for C/C++ language server integration (clangd and ccls). This module tests both Language.CPP (clangd) and Language.CPP_CCLS (ccls) using the same test repository. Tests are skipped if the respective language server is not available. """ import os import pathlib import shutil from pathlib import Path ...
239
11,197
serena
test/solidlsp/hlsl/test_hlsl_diagnostics.py
.py
import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.solidlsp.util.diagnostics import assert_file_diagnostics @pytest.mark.hlsl class TestHlslDiagnostics: @pytest.mark.parametrize("language_server", [LanguageServerId.HLSL], indirect=True) def test_f...
18
541
serena
test/solidlsp/hlsl/test_hlsl_full_index.py
.py
""" Regression tests for HLSL full symbol tree indexing. These tests verify that request_full_symbol_tree() correctly indexes all files, including .hlsl includes in subdirectories. This catches bugs where files are silently dropped during workspace-wide indexing. """ from typing import Any import pytest from solidl...
64
2,911
serena
test/solidlsp/hlsl/test_hlsl_basic.py
.py
""" Basic tests for HLSL language server integration (shader-language-server). This module tests Language.HLSL using shader-language-server from antaalt/shader-sense. Tests are skipped if the language server is not available. """ from typing import Any import pytest from solidlsp import SolidLanguageServer from sol...
176
8,907
serena
test/solidlsp/bash/test_bash_diagnostics.py
.py
import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.solidlsp.util.diagnostics import assert_file_diagnostics @pytest.mark.bash class TestBashDiagnostics: @pytest.mark.parametrize("language_server", [LanguageServerId.BASH], indirect=True) def test_f...
18
539
serena
test/solidlsp/bash/test_bash_basic.py
.py
""" Basic integration tests for the bash language server functionality. These tests validate the functionality of the language server APIs like request_document_symbols using the bash test repository. """ import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test...
136
6,951
serena
test/solidlsp/toml/test_toml_diagnostics.py
.py
import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.solidlsp.util.diagnostics import assert_file_diagnostics @pytest.mark.toml class TestTomlDiagnostics: @pytest.mark.parametrize("language_server", [LanguageServerId.TOML], indirect=True) def test_f...
18
541
serena
test/solidlsp/toml/test_toml_ignored_dirs.py
.py
""" Tests for TOML language server directory ignoring functionality. These tests validate that the Taplo language server correctly ignores TOML-specific directories like target, .cargo, and node_modules. """ import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId pytes...
63
3,398
serena
test/solidlsp/toml/test_toml_edge_cases.py
.py
""" Tests for TOML language server edge cases and advanced features. These tests cover: - Inline tables - Multiline strings - Arrays of tables - Nested tables - Various TOML data types """ from pathlib import Path import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId...
274
15,269
serena
test/solidlsp/toml/test_toml_symbol_retrieval.py
.py
""" Tests for TOML language server symbol retrieval functionality. These tests focus on advanced symbol operations: - request_containing_symbol - request_document_overview - request_full_symbol_tree - request_dir_overview """ from pathlib import Path import pytest from solidlsp import SolidLanguageServer from solid...
188
9,989
serena
test/solidlsp/toml/test_toml_basic.py
.py
""" Basic integration tests for the TOML language server functionality. These tests validate the functionality of the Taplo language server APIs like request_document_symbols using the TOML test repository. """ from pathlib import Path import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config i...
250
15,000
serena
test/solidlsp/groovy/test_groovy_basic.py
.py
import os from pathlib import Path import pytest from serena.constants import SERENA_MANAGED_DIR_NAME from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerConfig, LanguageServerId from solidlsp.ls_utils import SymbolUtils from solidlsp.settings import SolidLSPSettings from test.solidl...
130
6,158
serena
test/solidlsp/ocaml/test_cross_file_refs.py
.py
""" Test cross-file references for OCaml. Cross-file references require OCaml >= 5.2 and ocaml-lsp-server >= 1.23.0. On environments without these (e.g. Windows CI with OCaml 4.14), only same-file references are asserted. """ import logging import os import pytest from solidlsp import SolidLanguageServer from solid...
78
3,258
serena
test/solidlsp/ocaml/test_ocaml_basic.py
.py
import os import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_utils import SymbolUtils from test.conftest import language_server_tests_enabled from test.solidlsp.conftest import format_symbol_for_assert, has_malformed_name, request_all_symbols @pyt...
170
9,609
serena
test/solidlsp/ocaml/test_ocaml_diagnostics.py
.py
import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.conftest import language_server_tests_enabled from test.solidlsp.util.diagnostics import assert_file_diagnostics @pytest.mark.skipif(not language_server_tests_enabled(LanguageServerId.OCAML), reason="OCam...
20
737
serena
test/solidlsp/wolfram/test_wolfram_basic.py
.py
import pytest from solidlsp.ls import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.conftest import language_server_tests_enabled pytestmark = [ pytest.mark.wolfram, pytest.mark.skipif( not language_server_tests_enabled(LanguageServerId.WOLFRAM), reason="Wolfram tests d...
67
3,509
serena
test/solidlsp/lua/test_lua_basic.py
.py
""" Tests for the Lua language server implementation. These tests validate symbol finding and cross-file reference capabilities for Lua modules and functions. """ import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_types import SymbolKind from test....
303
14,833
serena
test/solidlsp/markdown/test_markdown_basic.py
.py
""" Basic integration tests for the markdown language server functionality. These tests validate the functionality of the language server APIs like request_document_symbols using the markdown test repository. """ import pytest from serena.symbol import LanguageServerSymbol from solidlsp import SolidLanguageServer fr...
110
5,905
serena
test/solidlsp/scss/test_scss_basic.py
.py
""" Basic integration tests for the SCSS language server (Some Sass). Some Sass provides full @use/@forward workspace navigation, so this suite exercises both in-file document symbols and cross-file go-to-definition for variables and mixins. """ import os import re from pathlib import Path import pytest from serena...
399
23,925
serena
test/solidlsp/scss/test_scss_diagnostics.py
.py
""" Diagnostics tests for the SCSS / Sass / CSS language server (Some Sass). Two sources are exercised — the SCSS parser (undefined ``$variable``) and the plain-CSS parser (syntax error inside a rule body). ``somesass.css.diagnostics.enabled`` is flipped on at initialization so the .css path is not gated off; lint dia...
43
1,657
serena
test/solidlsp/html_ls/test_html_diagnostics.py
.py
""" Diagnostics smoke test for the HTML language server. ``vscode-html-language-server`` does not validate HTML structure itself — upstream ``vscode-html-languageservice`` only forwards validation to embedded sub-services (CSS/JS in ``<style>`` / ``<script>`` blocks), and those aren't wired up in standalone mode. So a...
28
1,297
serena
test/solidlsp/html_ls/test_html_basic.py
.py
""" Basic integration tests for the HTML language server. The HTML LSP (vscode-html-language-server) provides in-file document symbols based on the element tree. Cross-file navigation (definition / references) is not meaningful for HTML and is therefore not tested here. """ from pathlib import Path import pytest fr...
55
2,930
serena
test/solidlsp/ansible/test_ansible_basic.py
.py
""" Basic integration tests for the Ansible language server. These tests validate initialization, hover, and completion capabilities using the standard Ansible test repository. They work with the standard @ansible/ansible-language-server from npm. """ from pathlib import Path import pytest from solidlsp import Soli...
81
4,221
serena
test/solidlsp/elixir/test_elixir_integration.py
.py
""" Integration tests for Elixir language server with test repository. These tests verify that the language server works correctly with a real Elixir project and can perform advanced operations like cross-file symbol resolution. """ import os from pathlib import Path import pytest from serena.project import Project...
163
7,933
serena
test/solidlsp/elixir/__init__.py
.py
def _test_expert_available() -> str: """Test if Expert is available and return error reason if not.""" # Try to import and check Elixir availability try: from solidlsp.language_servers.elixir_tools.elixir_tools import ElixirTools # Check if Elixir is installed elixir_version = Elixi...
22
774
serena
test/solidlsp/elixir/test_elixir_ignored_dirs.py
.py
import os from collections.abc import Generator from pathlib import Path import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.conftest import language_server_tests_enabled, start_ls_context # These marks will be applied to all tests in this module pytestmar...
166
7,962
serena
test/solidlsp/elixir/test_elixir_symbol_retrieval.py
.py
""" Tests for the Elixir language server symbol-related functionality. These tests focus on the following methods: - request_containing_symbol - request_referencing_symbols - request_defining_symbol """ import os import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId ...
352
17,413
serena
test/solidlsp/elixir/test_elixir_basic.py
.py
""" Basic integration tests for the Elixir language server functionality. These tests validate the functionality of the language server APIs like request_references using the test repository. """ import os import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from so...
153
7,246
serena
test/solidlsp/elixir/conftest.py
.py
""" Elixir-specific test configuration and fixtures. """ import os import subprocess import time from pathlib import Path import pytest def ensure_elixir_test_repo_compiled(repo_path: str) -> None: """Ensure the Elixir test repository dependencies are installed and project is compiled. Next LS requires the...
175
6,419
serena
test/solidlsp/luau/test_luau_basic.py
.py
""" Tests for the Luau language server implementation. These tests validate symbol finding, within-file references, and cross-file reference capabilities for Luau modules and functions. """ import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.solidlsp.conft...
168
7,823
serena
test/solidlsp/luau/test_luau_dependency_provider.py
.py
"""Tests for the Luau language server dependency provider.""" from pathlib import Path from unittest.mock import patch import pytest from solidlsp.language_servers.luau_lsp import LuauLanguageServer from solidlsp.settings import SolidLSPSettings def _make_provider( tmp_path: Path, custom_settings: dict[str...
166
7,431
serena
test/solidlsp/cue/test_cue_basic.py
.py
"""Basic integration tests for the CUE language server (``cue lsp``).""" from pathlib import Path import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_utils import SymbolUtils from test.solidlsp.conftest import format_symbol_for_assert, has_malformed...
146
8,706
serena
test/solidlsp/util/test_zip.py
.py
import sys import zipfile from pathlib import Path import pytest from solidlsp.util.zip import SafeZipExtractor @pytest.fixture def temp_zip_file(tmp_path: Path) -> Path: """Create a temporary ZIP file for testing.""" zip_path = tmp_path / "test.zip" with zipfile.ZipFile(zip_path, "w") as zipf: ...
100
3,725
serena
test/solidlsp/util/test_ls_utils.py
.py
from __future__ import annotations import hashlib from pathlib import Path from unittest.mock import patch import pytest from solidlsp.ls_utils import FileUtils class _FakeResponse: def __init__(self, payload: bytes, final_url: str) -> None: self.status_code = 200 self.headers = {"content-encod...
107
3,730
serena
test/solidlsp/util/diagnostics.py
.py
from collections.abc import Sequence from solidlsp import SolidLanguageServer def assert_file_diagnostics( language_server: SolidLanguageServer, relative_file_path: str, expected_message_fragments: Sequence[str], min_count: int = 1, ) -> None: diagnostics = language_server.request_text_document_d...
20
701
serena
test/solidlsp/powershell/test_powershell_basic.py
.py
""" Basic integration tests for the PowerShell language server functionality. These tests validate the functionality of the language server APIs like request_document_symbols using the PowerShell test repository. """ import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServer...
198
11,229
serena
test/solidlsp/powershell/test_powershell_diagnostics.py
.py
import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.solidlsp.util.diagnostics import assert_file_diagnostics @pytest.mark.powershell class TestPowershellDiagnostics: @pytest.mark.parametrize("language_server", [LanguageServerId.POWERSHELL], indirect=Tr...
18
558
serena
test/solidlsp/pascal/__init__.py
.py
def _check_pascal_available() -> bool: """Check if Pascal language server (pasls) is available. Note: pasls will be auto-downloaded if not present, so Pascal support is always available. """ return True PASCAL_AVAILABLE = _check_pascal_available() def is_pascal_available() -> bool: """Retur...
16
397
serena
test/solidlsp/pascal/test_pascal_auto_update.py
.py
""" Unit tests for the Pascal language server auto-update functionality. These tests validate the version comparison, checksum verification, and other helper methods without requiring network access or the actual Pascal language server. """ from __future__ import annotations import hashlib import os import tarfile i...
256
10,692
serena
test/solidlsp/pascal/test_pascal_diagnostics.py
.py
import shutil import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.conftest import language_server_tests_enabled from test.solidlsp.util.diagnostics import assert_file_diagnostics pytestmark = [ pytest.mark.pascal, pytest.mark.skipif(not language_se...
26
874
serena
test/solidlsp/pascal/test_pascal_basic.py
.py
""" Basic integration tests for the Pascal language server functionality. These tests validate the functionality of the language server APIs like request_document_symbols using the Pascal test repository. Uses genericptr/pascal-language-server which returns SymbolInformation[] format: - Returns classes, structs, enum...
217
11,081
serena
test/solidlsp/nextflow/test_nextflow_basic.py
.py
import os import shutil from pathlib import Path import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_utils import SymbolUtils from test.conftest import start_default_ls_context pytestmark = pytest.mark.skipif(shutil.which("java") is None, reason="Ne...
108
6,932
serena
test/solidlsp/al/test_al_basic.py
.py
import os import pytest from serena.symbol import LanguageServerSymbol from solidlsp import SolidLanguageServer from solidlsp.language_servers.al_language_server import ALLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_types import SymbolKind from solidlsp.ls_utils import SymbolUtils f...
596
32,783
serena
test/solidlsp/kotlin/test_kotlin_diagnostics.py
.py
import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.conftest import language_server_tests_enabled from test.solidlsp.util.diagnostics import assert_file_diagnostics @pytest.mark.skipif(not language_server_tests_enabled(LanguageServerId.KOTLIN), reason="Kot...
20
742
serena
test/solidlsp/kotlin/test_kotlin_startup.py
.py
"""Regression tests for Kotlin LSP startup readiness handling.""" import logging from pathlib import Path from typing import Any, cast from unittest.mock import Mock, patch import pytest from solidlsp.language_servers.kotlin_language_server import KotlinLanguageServer from solidlsp.ls_config import LanguageServerCon...
110
4,306
serena
test/solidlsp/kotlin/test_kotlin_dependency_provider.py
.py
"""Tests for Kotlin Language Server dependency resolution and installation.""" from contextlib import nullcontext from pathlib import Path from unittest.mock import patch import pytest from solidlsp.dependency_provider import DownloadedDependency, DownloadedDependencyHashDatabase from solidlsp.language_servers.kotli...
276
11,039
serena
test/solidlsp/kotlin/test_kotlin_basic.py
.py
import os import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_types import SymbolKind from solidlsp.ls_utils import SymbolUtils from test.conftest import language_server_tests_enabled from test.solidlsp.conftest import format_symbol_for_assert, has_m...
74
4,219
serena
test/solidlsp/csharp/test_csharp_diagnostics.py
.py
import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.solidlsp.util.diagnostics import assert_file_diagnostics @pytest.mark.csharp class TestCsharpDiagnostics: @pytest.mark.parametrize("language_server", [LanguageServerId.CSHARP], indirect=True) def ...
18
544
serena
test/solidlsp/csharp/test_csharp_nuget_download.py
.py
"""Tests for C# language server NuGet package download from NuGet.org.""" import tempfile from pathlib import Path from unittest.mock import patch import pytest from solidlsp.language_servers.common import RuntimeDependency from solidlsp.language_servers.csharp_language_server import ROSLYN_LONGEST_KNOWN_PACKAGE_MEM...
161
7,613
serena
test/solidlsp/csharp/test_csharp_basic.py
.py
import os import tempfile from pathlib import Path from typing import cast import pytest from solidlsp import SolidLanguageServer from solidlsp.language_servers.csharp_language_server import ( breadth_first_file_scan, find_solution_or_project_file, ) from solidlsp.ls_config import LanguageServerId from solidl...
342
16,732
serena
test/solidlsp/deno/test_deno_basic.py
.py
from pathlib import Path import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_types import Hover from solidlsp.ls_utils import SymbolUtils from test.conftest import language_server_tests_enabled def _hover_text(hover: Hover | None) -> str: """Fl...
90
5,600
serena
test/solidlsp/clojure/__init__.py
.py
from pathlib import Path from solidlsp.language_servers.clojure_lsp import verify_clojure_cli def _test_clojure_cli() -> bool: try: verify_clojure_cli() return False except (FileNotFoundError, RuntimeError): return True CLI_FAIL = _test_clojure_cli() TEST_APP_PATH = Path("src") / "t...
22
485
serena
test/solidlsp/clojure/test_clojure_diagnostics.py
.py
import os import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.solidlsp.util.diagnostics import assert_file_diagnostics @pytest.mark.clojure class TestClojureDiagnostics: @pytest.mark.parametrize("language_server", [LanguageServerId.CLOJURE], indirect=...
20
637
serena
test/solidlsp/clojure/test_clojure_basic.py
.py
import pytest from serena.project import Project from solidlsp.ls import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_types import SymbolKind, UnifiedSymbolInformation from test.conftest import language_server_tests_enabled from test.solidlsp.conftest import format_symbol_for_as...
244
12,369
serena
test/solidlsp/clojure/test_clojure_indexing.py
.py
"""Regression tests for clojure-lsp project-wide indexing. Bug: ``find_referencing_symbols`` (and the underlying ``request_references``) returns incomplete cross-file results unless the referencing files have already been opened/indexed during the current session via ``find_symbol`` / ``get_symbols_overview``. The res...
111
6,397
serena
test/solidlsp/elm/test_elm_diagnostics.py
.py
import shutil import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from test.solidlsp.util.diagnostics import assert_file_diagnostics @pytest.mark.elm @pytest.mark.skipif(shutil.which("node") is None or shutil.which("npm") is None, reason="Elm diagnostics require No...
21
682
serena
test/solidlsp/elm/test_elm_basic.py
.py
import os import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_utils import SymbolUtils from test.conftest import language_server_tests_enabled from test.solidlsp.conftest import format_symbol_for_assert, has_malformed_name, request_all_symbols @pyt...
71
3,910
serena
test/solidlsp/fsharp/test_fsharp_module_selection_range.py
.py
""" Regression test for #925: FsAutoComplete's selectionRange for a `module <Name>` declaration points at the `module` keyword rather than at `<Name>`, so hovering a module reports the generic keyword's docs instead of the module's own (confirmed by dsyme and MischaPanch in the issue thread). This pins FSharpLanguageSe...
133
5,933
serena
test/solidlsp/fsharp/test_fsharp_basic.py
.py
import os import threading from typing import Any import pytest from solidlsp import SolidLanguageServer from solidlsp.ls_config import LanguageServerId from solidlsp.ls_utils import SymbolUtils from test.conftest import ( find_identifier_position, get_repo_path, language_server_tests_enabled, ls_has_...
224
11,398
serena
test/serena/test_cli_project_commands.py
.py
"""Tests for CLI project commands (create, index).""" import os import shutil import tempfile import time from pathlib import Path import pytest from click import Command, Option from click.testing import CliRunner from serena.cli import ProjectCommands, TopLevelCommands, find_project_root from serena.config.serena_...
385
17,519
serena
test/serena/test_ls_file_sync.py
.py
""" End-to-end test for language server file synchronisation as a result of externally-made file changes. Exercises all three ``FileChangeType`` branches against a real pyright backend: Created (new caller file), Changed (append a second caller), Deleted (remove the caller file). """ import json import os import shut...
192
9,826
serena
test/serena/test_tool_parameter_types.py
.py
import logging import pytest from serena.config.serena_config import SerenaConfig from serena.mcp import SerenaMCPFactory from serena.tools.tools_base import ToolRegistry @pytest.mark.parametrize("context", ("chatgpt", "codex", "oaicompat-agent")) def test_all_tool_parameters_have_type(context): """ For eve...
40
1,505
serena
test/serena/test_jetbrains_plugin_client.py
.py
import pytest from serena.constants import REPO_ROOT from serena.jetbrains.jetbrains_plugin_client import JetBrainsPluginClient class TestSerenaJetBrainsPluginClient: @pytest.mark.parametrize( "serena_path, plugin_path", [ (REPO_ROOT, REPO_ROOT), ("/home/user/project", "/h...
21
832
serena
test/serena/test_activation_command.py
.py
"""Tests for SerenaAgent._run_activation_command.""" import logging import sys from pathlib import Path import pytest from serena.config.serena_config import ProjectConfig, SerenaConfig from serena.project import Project from solidlsp.ls_config import LanguageServerId def _make_project( project_root: Path, ...
101
4,200
serena
test/serena/test_symbol.py
.py
from unittest.mock import MagicMock import pytest from serena.jetbrains.jetbrains_types import SymbolDTO, SymbolDTOKey from serena.project import Project from serena.symbol import LanguageServerSymbol, LanguageServerSymbolRetriever, NamePathComponent, NamePathMatcher from test.solidlsp.conftest import PYTHON_BACKEND_...
448
23,285
serena
test/serena/test_task_executor.py
.py
import time import pytest from serena.task_executor import TaskExecutor @pytest.fixture def executor(): """ Fixture for a basic SerenaAgent without a project """ return TaskExecutor("TestExecutor") class Task: def __init__(self, delay: float, exception: bool = False): self.delay = dela...
127
3,677
serena
test/serena/test_cli_setup.py
.py
from types import SimpleNamespace from click.testing import CliRunner from serena.cli import TopLevelCommands from serena.util.shell import ShellCommandResult GROK_ADD_COMMAND = "grok mcp add --scope user serena -- serena start-mcp-server --context=grok --project-from-cwd" def _result(command: str, return_code: in...
92
3,969
serena
test/serena/test_text_utils.py
.py
from collections.abc import Callable import pytest from serena.util.file_proxy import FileCollection, FileProxy from serena.util.text_utils import GlobMatcher, LineType, MultiFileContentReplacer, search_files, search_text class TestSearchText: def test_search_text_with_string_pattern(self): """Test sear...
659
29,243
serena
test/serena/test_mcp.py
.py
"""Tests for the mcp.py module in serena.""" import pytest from mcp.server.fastmcp.tools.base import Tool as MCPTool from serena.agent import Tool, ToolRegistry from serena.config.context_mode import SerenaAgentContext from serena.mcp import SerenaMCPFactory make_tool = SerenaMCPFactory.make_mcp_tool # Create a mo...
301
9,581
serena
test/serena/test_dashboard.py
.py
from collections.abc import Callable from types import SimpleNamespace from serena.dashboard import SerenaDashboardAPI from solidlsp.ls_config import LanguageServerId class _DummyMemoryLogHandler: def get_log_messages(self, from_idx: int = 0): # pragma: no cover - simple stub return SimpleNamespace(mess...
54
2,087
serena
test/serena/test_project_server.py
.py
import threading from collections.abc import Iterator from concurrent.futures import ThreadPoolExecutor from concurrent.futures import TimeoutError as FutureTimeoutError from contextlib import contextmanager from pathlib import Path from typing import Any, cast from unittest.mock import MagicMock import pytest from s...
200
7,767