testsAndMisc/python_pkg/brother_printer
Krzysztof kuhy Rudnicki 2832b7841f Reduce brother_printer/display.py and dedup the consumable bars
Partial: display.py 427 -> 342. Still a violation, not yet cleared.

Moved out only what no test patches:
  _supply.py    the supply-level arithmetic (imported by tests, not patched)
  _severity.py  the three _SEVERITY_* tables (pure data)

Also collapsed the toner and drum bars in _display_page_count_estimate into
_supply.render_life_bar. They were the same logic with different colours and
notes, so this removes duplication rather than relocating it.

The remaining ~92 lines are blocked on mock.patch pinning. This package's test
modules patch ~90 names via patch(f"{MOD}.<name>"), and a patched name only
resolves in the module the test names -- moving a function that calls one
breaks the mock. An attempt to move the page-count block was reverted for
exactly that (display has no attribute 'estimate_consumable_life'). Clearing
it needs either test edits or ~8 delegate stubs, which is a decision to take
rather than assume.

402 tests pass, unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-16 16:39:02 +02:00
..
tests fix(brother-printer): split oversized files, fix order-dependent entry test 2026-07-17 15:06:25 +02:00
__init__.py feat: brother printer checker 2026-02-06 21:21:52 +01:00
__main__.py fix(brother-printer): report the truth, not invented status codes 2026-07-17 14:49:23 +02:00
_query.py feat: split oversized modules for 500-line limit, fix kasa coverage gap 2026-06-14 07:19:37 +02:00
_severity.py Reduce brother_printer/display.py and dedup the consumable bars 2026-08-16 16:39:02 +02:00
_supply.py Reduce brother_printer/display.py and dedup the consumable bars 2026-08-16 16:39:02 +02:00
check_brother_printer.py fix(brother-printer): split oversized files, fix order-dependent entry test 2026-07-17 15:06:25 +02:00
constants.py fix(brother-printer): report the truth, not invented status codes 2026-07-17 14:49:23 +02:00
consumables.py fix(brother-printer): split oversized files, fix order-dependent entry test 2026-07-17 15:06:25 +02:00
cups_queue.py feat: split oversized modules for 500-line limit, fix kasa coverage gap 2026-06-14 07:19:37 +02:00
cups_service.py fix(brother-printer): split oversized files, fix order-dependent entry test 2026-07-17 15:06:25 +02:00
data_classes.py fix(brother-printer): report the truth, not invented status codes 2026-07-17 14:49:23 +02:00
display.py Reduce brother_printer/display.py and dedup the consumable bars 2026-08-16 16:39:02 +02:00
network_query.py feat: split oversized modules for 500-line limit, fix kasa coverage gap 2026-06-14 07:19:37 +02:00
run.sh fix(brother-printer): report the truth, not invented status codes 2026-07-17 14:49:23 +02:00
usb_query.py fix(brother-printer): report the truth, not invented status codes 2026-07-17 14:49:23 +02:00