test(update): strengthen UnicodeDecodeError regression to assert_not_called()

Follow-up per review of #74631.

The prior assertion (call_count == 0 OR interactive != True) also
passed if an unintended non-interactive migration occurred, which the
safe fallback (response='n') is supposed to prevent entirely. Replaced
with mock_migrate.assert_not_called().

6/6 pass in the full tests/hermes_cli/test_update_yes_flag.py file.
This commit is contained in:
ygd58 2026-07-31 13:18:13 +00:00 committed by Teknium
parent 70957591ff
commit 0b73330f7c
1 changed files with 1 additions and 3 deletions

View File

@ -181,9 +181,7 @@ class TestUnicodeDecodeErrorInUpdatePrompts:
out = capsys.readouterr().out
assert "hermes config migrate" in out
assert mock_migrate.call_count == 0 or (
mock_migrate.call_args and mock_migrate.call_args.kwargs.get("interactive") is not True
)
mock_migrate.assert_not_called()
def test_stash_restore_unicode_decode_error_falls_through_to_skip(self, tmp_path, capsys):
from hermes_cli.update_cmd import _restore_stashed_changes