[PR #222] [MERGED] tests: cover um kb search on a cp1252 console #225

Closed
opened 2026-10-15 20:54:32 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rehan-remade/universal-modder/pull/222
Author: @Ramnath0521
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @rehan-remade

Base: main ← Head: test/cli-cp1252-search


📝 Commits (3)

  • 69649ee tests: cover um kb search on a cp1252 console
  • e95f493 tests: keep the in-process cp1252 test next to the subprocess one
  • 959bf30 Merge remote-tracking branch 'origin/main' into land/pr-222

📊 Changes

1 file changed (+16 additions, -0 deletions)

View changed files

📝 tests/test_um.py (+16 -0)

📄 Description

Follow-up to #184, as suggested there. Refs #152.

This adds only the in-process test; no source change. It runs cli.main(["kb", "search", ...]) against a note containing ≥ and →, with sys.stdout replaced by a cp1252 text wrapper over a byte buffer, and checks that the output arrives as UTF-8. That is the path #152 reported (um kb search printing hit snippets), which the subprocess test in #154 does not exercise (it runs um kb show).

I checked it against current main on Windows 11 / Python 3.12:

  • With the fix from #154 in place it passes, as does the rest of the suite (89 passed).
  • Without the reconfigure() call in um/cli.py it fails with UnicodeEncodeError: 'charmap' codec can't encode character '\u2265', so it does guard the fix.

Written with AI assistance (Claude Code). I ran the test on my own Windows machine, read the diff, and verified it passes with the fix and fails without it. Errors are mine.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rehan-remade/universal-modder/pull/222 **Author:** [@Ramnath0521](https://github.com/Ramnath0521) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@rehan-remade](https://github.com/rehan-remade) **Base:** `main` ← **Head:** `test/cli-cp1252-search` --- ### 📝 Commits (3) - [`69649ee`](https://github.com/rehan-remade/universal-modder/commit/69649ee3e86c9b381edf9e8891b3f9865cd1d068) tests: cover um kb search on a cp1252 console - [`e95f493`](https://github.com/rehan-remade/universal-modder/commit/e95f493b9645bb0b94d7310861f02359bc7aa644) tests: keep the in-process cp1252 test next to the subprocess one - [`959bf30`](https://github.com/rehan-remade/universal-modder/commit/959bf307d0062c2ac3aff512439bda8baa035fe9) Merge remote-tracking branch 'origin/main' into land/pr-222 ### 📊 Changes **1 file changed** (+16 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_um.py` (+16 -0) </details> ### 📄 Description Follow-up to #184, as suggested there. Refs #152. This adds only the in-process test; no source change. It runs `cli.main(["kb", "search", ...])` against a note containing `≥` and `→`, with `sys.stdout` replaced by a cp1252 text wrapper over a byte buffer, and checks that the output arrives as UTF-8. That is the path #152 reported (`um kb search` printing hit snippets), which the subprocess test in #154 does not exercise (it runs `um kb show`). I checked it against current `main` on Windows 11 / Python 3.12: - With the fix from #154 in place it passes, as does the rest of the suite (89 passed). - Without the `reconfigure()` call in `um/cli.py` it fails with `UnicodeEncodeError: 'charmap' codec can't encode character '\u2265'`, so it does guard the fix. --- Written with AI assistance (Claude Code). I ran the test on my own Windows machine, read the diff, and verified it passes with the fix and fails without it. Errors are mine. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 20:54:32 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rehan-remade/universal-modder#225
No description provided.