Skip to content

Cover the operator chip, a stale highlight and an unnamed sick hand - #239

Merged
dmccoystephenson merged 1 commit into
mainfrom
test/operator-chip-stale-highlight-unnamed-sick-hand
Oct 28, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
test/operator-chip-stale-highlight-unnamed-sick-hand

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Stage B (unit-test expansion) cycle. Three reachable, behaviour-bearing branches were found uncovered and are now pinned as they behave today. No production code is changed.

  • src/ui/baseUserInterface.py:63: the [OPERATOR MODE] header chip and its operator class are asserted in tests/ui/test_webUserInterface.py, alongside the existing energy-chip test.
  • src/ui/pygameUserInterface.py:184: a highlight left on a row that has since gone grey is shown to step in from the nearest end (DOWN lands on the first selectable row, UP on the last). The test is in tests/ui/test_pygameUserInterface.py.
  • src/business/adventures.py:280: pressing on through sickness with a crew of unnamed hands is shown to take one off the headcount and to report "a hand" rather than a name. The roll is patched to 0.0. The test is in tests/business/test_adventures.py.

Coverage of src went from 16 missed lines to 13. The lines still missed are the ones already recorded as unreachable guards, the __main__ block, vendored client code or the protected saveFileManager.py.

Before this work was picked, a Stage A documentation sweep was run on what changed since the last one (the location stills from #235 and #236). The README's stills section was checked against src/stills/stills.py, art/stills.json, art/render.py, tests/stills/test_stills.py and tak's picture support in each front-end. PLANNING.md and the Python versions in the Dockerfile and both workflows were also checked. No drift was found, so no docs change is included.

No tracking issue: the gap was found during triage, with the issue backlog empty.

Test plan

  • Full suite under dummy SDL drivers: 1063 passed (1060 before).
  • black --check on the three changed test files.
  • CI green on the PR head.

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

Three reachable branches had no test: the [OPERATOR MODE] header chip,
the pygame highlight stepping in from the nearest end when it sits on a
row that has gone grey, and pressing on through sickness with a crew of
unnamed hands. Each is pinned as it behaves today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (one pass, scored against the diff and CI run 40651081053):

  • Scope: PASS. Three test files changed (+43, no deletions), one test each for the three uncovered lines named in the description. No production code, formatting or rename churn.
  • Tests-new: PASS. No new public functions. Three tests were added for existing branches.
  • Tests-fix: N/A. No bug fix is included, so nothing exists to stash and revert. These tests characterize current behaviour.
  • Sibling structure: PASS. Each test sits beside its nearest sibling (test_header_includes_max_energy, test_selection_skips_unavailable_options, test_unnamed_hands_lost_at_sea_are_taken_off_the_headcount) and reuses that file's factory (makeWebUI, makeUI) and comment style.
  • Sibling renames: N/A. No renames.
  • Docs: PASS. No behaviour changed, so no README, schema or PLANNING row is affected. A separate Stage A sweep of the stills docs found no drift.
  • Issue resolution: N/A. No Closes; the gap was found during triage.
  • CI: PASS. test passed with 1063 tests, and the log shows each of the three new tests PASSED. docker passed.
  • Schema-sync: N/A. No persisted fields.
  • Money-format: N/A. No money displays.
  • Deterministic-tests: PASS. _sickPush's roll is patched to 0.0. The other two tests use no randomness.
  • Headless-pygame: PASS. The pygame test goes through makeUI() under the dummy SDL drivers, the same as its neighbours, and calls ui.cleanup() in finally.
  • camelCase: PASS. No new production identifiers. Test names follow the file's snake_case test_* convention.

Judgment notes:

  • tests/business/test_adventures.py:300: the new test repeats the five-line unnamed-crew setup from the test above it rather than extracting a helper. That was left as is, to match how this file sets up its other one-off voyages. A shared helper would be reasonable if a third unnamed-crew test is ever added.
  • tests/ui/test_pygameUserInterface.py:507: the stale-highlight test calls _moveSelection twice from the same selected_option. That only holds because _moveSelection returns the new index without assigning it, and src/ui/pygameUserInterface.py:185 confirms that.

All items pass or are not applicable. The PR is ready to merge: test-only, with no do-not-auto-merge path touched.

This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 6072be4 into main Oct 28, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the test/operator-chip-stale-highlight-unnamed-sick-hand branch October 28, 2026 07:38
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.

1 participant