mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
test(delegate): assert copilot probe with assert_any_call to de-flake under slicing
test_build_child_agent_ignores_acp_command_when_binary_missing patches
shutil.which globally and asserted the LAST call was which("copilot").
That is order-dependent: an unrelated which("uv") reached later in the same
process (which happens under some CI test-slice orderings) becomes the last
call, so assert_called_with("copilot") fails even though the copilot binary
was probed exactly as intended. Switch to assert_any_call("copilot"), which
verifies the actual intent and is robust to unrelated which() calls. The
behavioural assertions (provider, acp_command, acp_args) are unchanged.
This commit is contained in:
parent
7ada946436
commit
bebcf95847
1 changed files with 5 additions and 1 deletions
|
|
@ -562,7 +562,11 @@ class TestToolNamePreservation(unittest.TestCase):
|
|||
captured["acp_command"] = kwargs.get("acp_command")
|
||||
captured["acp_args"] = kwargs.get("acp_args")
|
||||
|
||||
mock_which.assert_called_with("copilot")
|
||||
# any_call, not called_with: the patch is global to shutil.which, so an
|
||||
# unrelated which("uv") from a code path reached later in the same
|
||||
# process (order-dependent under CI test-slicing) can be the *last*
|
||||
# call. The intent here is only that the copilot binary was probed.
|
||||
mock_which.assert_any_call("copilot")
|
||||
self.assertNotEqual(
|
||||
captured["provider"],
|
||||
"copilot-acp",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue