c3749daf48
Tests / test-linux (3.13) (push) Failing after 0s
Tests / test-linux (3.11) (push) Failing after 1s
Tests / lint (push) Failing after 0s
Tests / test-linux (3.9) (push) Failing after 1s
Docker / build (push) Failing after 1s
Docker / build-gpu (push) Failing after 2s
Tests / test-windows (push) Has been cancelled
Tests / test-macos (push) Has been cancelled
23 lines
764 B
Python
23 lines
764 B
Python
import re
|
|
from pathlib import Path
|
|
|
|
from mempalace import __version__
|
|
from mempalace.mcp_server import handle_request
|
|
|
|
|
|
def _expected_version() -> str:
|
|
pyproject = Path(__file__).resolve().parents[1] / "pyproject.toml"
|
|
content = pyproject.read_text(encoding="utf-8")
|
|
match = re.search(r'^version\s*=\s*"([^"]+)"', content, re.MULTILINE)
|
|
assert match is not None, "Could not find project version in pyproject.toml"
|
|
return match.group(1)
|
|
|
|
|
|
def test_package_version_matches_pyproject():
|
|
assert __version__ == _expected_version()
|
|
|
|
|
|
def test_mcp_initialize_reports_package_version():
|
|
response = handle_request({"jsonrpc": "2.0", "id": 1, "method": "initialize"})
|
|
assert response["result"]["serverInfo"]["version"] == _expected_version()
|