feat: harden runtime readiness and session workflow
This commit is contained in:
@@ -2,7 +2,7 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from tht.config import ConfigError, load_config
|
||||
from tht.config import ConfigError, load_config, workspace_id_from_path
|
||||
from tht.paths import resolve_workspace_paths
|
||||
|
||||
|
||||
@@ -108,3 +108,15 @@ def test_no_data_root_preserves_legacy_relative_paths(monkeypatch, tmp_path):
|
||||
|
||||
assert cfg.paths.sessions == Path("sessions")
|
||||
assert cfg.paths.artifacts == Path("artifacts")
|
||||
|
||||
|
||||
def test_workspace_identity_resolves_config_symlink(tmp_path):
|
||||
(tmp_path / "workspaces").mkdir()
|
||||
workspace = _write_config(tmp_path / "workspaces/local.yaml")
|
||||
alias = tmp_path / "config/tht.yaml"
|
||||
alias.parent.mkdir()
|
||||
alias.symlink_to(workspace)
|
||||
|
||||
assert workspace_id_from_path(alias) == "local"
|
||||
assert load_config(alias)._workspace_id == "local"
|
||||
assert load_config(alias)._config_source == workspace.resolve().as_posix()
|
||||
|
||||
Reference in New Issue
Block a user