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)
| 377 | |
| 378 | @pytest.mark.parametrize("ends", [("run()", ".nonce()"), (".nonce()", "run()")]) |
| 379 | def 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"]) |
nothing calls this directly
no test coverage detected