Merge pull request #16 from sheetsync/bugfix/version-consistency
fix: unify package and MCP version reporting
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user