Files
omnigent-ai--omnigent/tests/test_data_dir_isolation.py
Corey Zumar 3b6816703f fix(tests): isolate Omnigent runtime data (#5118)
* fix(tests): isolate Omnigent runtime data

Signed-off-by: dbczumar <corey.zumar@databricks.com>

* test: preserve explicit e2e data isolation

Signed-off-by: dbczumar <corey.zumar@databricks.com>

---------

Signed-off-by: dbczumar <corey.zumar@databricks.com>
2026-08-21 23:00:36 -07:00

21 lines
743 B
Python

"""Regression coverage for pytest runtime-data isolation."""
from __future__ import annotations
import os
from pathlib import Path
from omnigent import cli
from omnigent.host import local_server
def test_pytest_uses_an_isolated_omnigent_data_dir() -> None:
"""Daemon state used by tests must never resolve under the real home."""
test_data_dir = Path(os.environ["OMNIGENT_DATA_DIR"]).resolve()
real_data_dir = (Path.home() / ".omnigent").resolve()
assert test_data_dir != real_data_dir
assert local_server._LOCAL_SERVER_PID_PATH.resolve().is_relative_to(test_data_dir)
assert cli._HOST_PID_PATH.resolve().is_relative_to(test_data_dir)
assert cli._daemon_registry_dir().resolve().is_relative_to(test_data_dir)