test: extend ASCII-only guarantee to 2fa remove and setup mode errors (#254)
Your AI's guard dog to stop it from going rogue.
Brought to you by:
doberman
Originally created by: Wsif123
Fixes issue [#254]: two user-facing CLI messages slipped non-ASCII dashes past the cp1252-safe onboarding guarantee.
Both replaced with plain hyphens.
Extended \ ests/unit/test_cli_encode_safe.py\ so the ASCII guarantee covers the two paths that slipped through:
Verified both new tests FAIL when the character fixes are reverted. \
uff check\, \
uff format --check\ and all unit tests in the touched files pass.
None - behavior and public API unchanged; only two user-facing strings and the tests covering them.
Originally posted by: fu351
This is exactly the right work filed in the wrong container - easy fix. What you've written is a PR description, but no code arrived with it: push your branch to your fork and open a pull request (GitHub's "Compare & pull request" button, or
gh pr create). The substance is spot on - verifying that your new tests go red when the character fixes are reverted is precisely this repo's bar for a test PR, so say that in the PR body too.One heads-up before you open it: the
parse_mode_choiceen-dash was already fixed as a side effect of [#266] (see the note on [#254]), so rebase on current main first. Keep both of your new tests - the setup-mode one now guards the fixed message against regression - plus the2fa removeem-dash fix, which is still live.Closing this so the conversation stays on [#254], which is now assigned to you. Looking forward to the PR. We also hang out in Discord if you want a faster loop on questions: https://discord.gg/Sfy5XGNqty - entirely optional.
Related
Tickets:
#254Tickets:
#266Ticket changed by: fu351
Originally posted by: Wsif123
Rebased on current main (which already contains [#266]'s en-dash fix and re-prompt wizard) and reworked the setup-mode test to match: a bad mode choice now re-prompts instead of exiting, so the test feeds a valid choice after the invalid one and asserts the parse_mode_choice message stays ASCII + cp1252-safe. The 2fa remove em-dash fix is still live on main and covered by the other new test. Verified: new tests go red when the em-dash is restored.
Related
Tickets:
#266