from pathlib import Path from rdb_discovery.templates import write_file_if_missing def test_write_file_if_missing(tmp_path: Path) -> None: assert write_file_if_missing(tmp_path, "context/test.md", "hello") is True assert (tmp_path / "context" / "test.md").read_text(encoding="utf-8") == "hello" assert write_file_if_missing(tmp_path, "context/test.md", "changed") is False assert (tmp_path / "context" / "test.md").read_text(encoding="utf-8") == "hello"