mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-08 13:12:08 +00:00
test(tui_gateway): isolate verification.status not_applicable test from stray tmp markers
test_verification_status_outside_workspace_is_not_applicable passed tmp_path as the cwd and asserted status == not_applicable, relying on tmp_path having no project-marker ancestor. _marker_root() walks up to ~6 levels, so a stray marker in a shared tmp-root ancestor (e.g. a /tmp/package.json left by another tool) made project_facts_for() resolve tmp_path as a workspace and flip the status to unverified. Green in clean CI, red on any dev box with a polluted /tmp. Force the no-facts precondition by monkeypatching project_facts_for -> None so the test deterministically exercises the not_applicable branch regardless of ambient filesystem state. Test-only; no production change.
This commit is contained in:
parent
4df2536f21
commit
83e6a487eb
1 changed files with 11 additions and 1 deletions
|
|
@ -6476,7 +6476,17 @@ def test_verification_status_returns_recorded_evidence(tmp_path):
|
|||
assert verification["evidence"]["scope"] == "full"
|
||||
|
||||
|
||||
def test_verification_status_outside_workspace_is_not_applicable(tmp_path):
|
||||
def test_verification_status_outside_workspace_is_not_applicable(monkeypatch, tmp_path):
|
||||
# A cwd with no project facts (outside any code workspace) must report
|
||||
# not_applicable. Force the "no facts" precondition rather than relying on
|
||||
# tmp_path's ancestors being pristine — a stray marker file in a shared
|
||||
# tmp-root ancestor (e.g. /tmp/package.json left by another tool) would
|
||||
# otherwise make _marker_root() resolve tmp_path as a workspace and flip
|
||||
# the status to "unverified".
|
||||
import agent.coding_context as coding_context
|
||||
|
||||
monkeypatch.setattr(coding_context, "project_facts_for", lambda _cwd=None: None)
|
||||
|
||||
home = tmp_path / ".hermes"
|
||||
home.mkdir()
|
||||
token = set_hermes_home_override(home)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue