Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions tests/cli_commands/test_project_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ def register(knowledge_root: Path) -> tuple[str, Path]:
r'Inspect C:\tools\new and "quoted text".',
"Compare --- in prose & preserve <tags>.",
"Example\u2028## Agent Todo\u2029- [ ] Example only.",
"比较中文输入并保留 café 与 🧪。",
])
def test_project_register_repeated_identical_request_is_a_noop(
tmp_path: Path,
Expand Down Expand Up @@ -544,25 +545,25 @@ def test_project_register_repeated_identical_request_is_a_noop(

# A completed creation receipt does not roll later presentation back to the
# initial template, including updated metadata or owner-written narrative.
text = state_file.read_text()
text = state_file.read_text(encoding="utf-8")
header, body = text.split("\n---\n", 1)
header = "\n".join(
"objective: " + json.dumps(objective, ensure_ascii=True)
if line.startswith("objective: ") else line for line in header.split("\n")
)
equivalent = header + "\n---\n" + body
state_file.write_text(equivalent)
state_file.write_text(equivalent, encoding="utf-8")
assert main(arguments) == 0
capsys.readouterr()
assert state_file.read_text() == equivalent
assert state_file.read_text(encoding="utf-8") == equivalent
for drifted in (equivalent.replace("status: active", "status: paused", 1),
equivalent.replace("A verified Spec diff is produced.", "Different acceptance.", 1)):
state_file.write_text(drifted)
state_file.write_text(drifted, encoding="utf-8")
assert main(arguments) == 0
replay = json.loads(capsys.readouterr().out)
assert replay["changed"] is False
assert replay["storage_selection"]["status"] == "replayed"
assert state_file.read_text() == drifted
assert state_file.read_text(encoding="utf-8") == drifted
assert registry_path.read_bytes() == registry_before


Expand Down
Loading