MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / test_path_refuses_ambiguous_endpoint

Function test_path_refuses_ambiguous_endpoint

tests/test_path_cli.py:379–394  ·  view source on GitHub ↗

A bare label naming symbols in two files is refused with the candidate ids, as `explain` does, instead of a confident route through one of them — on either end of the path.

(monkeypatch, tmp_path, capsys, ends)

Source from the content-addressed store, hash-verified

377
378@pytest.mark.parametrize("ends", [("run()", ".nonce()"), (".nonce()", "run()")])
379def test_path_refuses_ambiguous_endpoint(monkeypatch, tmp_path, capsys, ends):
380 """A bare label naming symbols in two files is refused with the candidate ids,
381 as `explain` does, instead of a confident route through one of them — on
382 either end of the path."""
383 gp = _twin_method_graph(tmp_path)
384 monkeypatch.setattr(mainmod, "_check_skill_version", lambda _: None)
385 monkeypatch.setattr(mainmod.sys, "argv",
386 ["graphify", "path", *ends, "--graph", str(gp)])
387 with pytest.raises(SystemExit) as exc_info:
388 mainmod.main()
389 assert exc_info.value.code == EXIT_AMBIGUOUS
390 captured = capsys.readouterr()
391 assert "Shortest path" not in captured.out
392 assert "Ambiguous: '.nonce()' matches 2 nodes in different files." in captured.err
393 assert "src_a_alphaclient_nonce" in captured.err
394 assert "src_b_betaclient_nonce" in captured.err
395
396
397@pytest.mark.parametrize("target", ["src/b.ts::.nonce()", "src_b_betaclient_nonce"])

Callers

nothing calls this directly

Calls 1

_twin_method_graphFunction · 0.85

Tested by

no test coverage detected