Archived
chore: scaffold Python service
This commit is contained in:
1 parent
c5660a89dd
commit
bcf1e9a9a9
14 files changed
+854
-10
No files matched your search
@@ -0,0 +1,26 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from recoll_modern.config import Settings
|
||||
|
||||
|
||||
def test_settings_are_rooted_in_configured_state(tmp_path: Path) -> None:
|
||||
settings = Settings.from_env(
|
||||
{
|
||||
"RECOLL_MODERN_DOCUMENT_ROOT": str(tmp_path / "docs"),
|
||||
"RECOLL_MODERN_STATE_ROOT": str(tmp_path / "state"),
|
||||
"RECOLL_MODERN_HOST": "127.0.0.1",
|
||||
"RECOLL_MODERN_PORT": "9123",
|
||||
"RECOLL_MODERN_ROOT_PATH": "/recoll",
|
||||
}
|
||||
)
|
||||
|
||||
assert settings.database_path == tmp_path / "state" / "recoll-modern.sqlite3"
|
||||
assert settings.membership_map_path == tmp_path / "state" / "membership.map"
|
||||
assert (settings.host, settings.port, settings.root_path) == ("127.0.0.1", 9123, "/recoll")
|
||||
|
||||
|
||||
def test_root_path_rejects_trailing_slash() -> None:
|
||||
with pytest.raises(ValueError, match="mount prefix"):
|
||||
Settings.from_env({"RECOLL_MODERN_ROOT_PATH": "/recoll/"})
|
||||
Reference in new issue
Block a user