Skip to content

Commit bac04d2

Browse files
committed
Add test
1 parent f551715 commit bac04d2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/test_mcp_resources.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from __future__ import annotations
2+
3+
from pathlib import Path
4+
import sys
5+
6+
import pytest
7+
8+
ROOT = Path(__file__).resolve().parents[1]
9+
SITE_PACKAGES = ROOT / ".venv" / "lib" / "python3.13" / "site-packages"
10+
if SITE_PACKAGES.exists():
11+
sys.path.append(str(SITE_PACKAGES))
12+
13+
pytest.importorskip("mcp.server.fastmcp")
14+
15+
from pdf2sqlite.mcp_server.config import ServerConfig
16+
from pdf2sqlite.mcp_server.server import build_server
17+
18+
19+
def test_server_builds_with_resource_templates() -> None:
20+
db_path = Path("docs.db").resolve()
21+
if not db_path.exists():
22+
pytest.skip("docs.db fixture missing")
23+
24+
config = ServerConfig(database_path=db_path)
25+
26+
build_server(config)

0 commit comments

Comments
 (0)