Skip to content

tests: compare the error reply of server.py as JSON - #970

Merged
PCMan merged 1 commit into
EasyIME:masterfrom
ilwu:fix-resilience-test
Oct 20, 2026
Merged

PCMan merged 1 commit into
EasyIME:masterfrom
ilwu:fix-resilience-test

Conversation

@ilwu

@ilwu ilwu commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

tests/test_backend_resilience.py::test_server_continues_after_client_exception has been failing on master since f7fed0a: server.py now builds the error reply with json.dumps(), which emits {"success": false} (with a space), while the test matched the exact string {"success":false}.

AssertionError: 'PIME_MSG|client-1|{"success":false}' not found in 'PIME_MSG|client-1|{"success": false}\n'

The behaviour under test is correct, only the assertion was too literal. The test now extracts the PIME_MSG|client-1| line and compares the decoded JSON, so the reply formatting no longer matters.

Verified with the bundled Python 3.12.9: python3\python.exe -m unittest discover -s tests -p "*test*.py" → 16 tests OK (was 1 failure).

Generated with assistance from Claude Code (Claude Fable 5.1).

* test_server_continues_after_client_exception now parses the
  PIME_MSG reply instead of matching a fixed string.

server.py builds the error reply with json.dumps() since f7fed0a, which
emits {"success": false} with a space, so the exact-string assertion
has been failing on master even though the behaviour is correct. The
test now checks the decoded JSON, so the formatting of the reply no
longer matters.

Generated with assistance from Claude Code (Claude Fable 5.1).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@PCMan PCMan self-assigned this Oct 20, 2026
@PCMan
PCMan merged commit 1586374 into EasyIME:master Oct 20, 2026
3 checks passed
@PCMan

PCMan commented Oct 20, 2026

Copy link
Copy Markdown
Member

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants