mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 22:54:01 +01:00
test_consumables_part2.py 273 -> 133 (renamed test_counter_scales.py), test_consumables.py 272 -> 123, test_check_brother_printer.py 275 -> 112. python_pkg/brother_printer is now entirely under the 250-line cap, from fifteen violations at the start. The consumables split lands exactly on the MOD/MOD_PD boundary an earlier commit introduced, so the two-constant workaround dissolves instead of being carried forward - each file has one module under test again. Pass count is 402, unchanged across all eight commits of this pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
49 lines
3.5 KiB
JSON
49 lines
3.5 KiB
JSON
{
|
|
"intent": "Clear the last three over-cap brother_printer test modules, taking the package from fifteen violations to zero.",
|
|
"scope": [
|
|
"python_pkg/brother_printer/tests/test_consumables_part2.py -> test_counter_scales.py (273 -> 133)",
|
|
"python_pkg/brother_printer/tests/test_page_delivery.py (new)",
|
|
"python_pkg/brother_printer/tests/test_consumables.py (272 -> 123)",
|
|
"python_pkg/brother_printer/tests/test_consumable_estimate.py (new)",
|
|
"python_pkg/brother_printer/tests/test_check_brother_printer.py (275 -> 112)",
|
|
"python_pkg/brother_printer/tests/test_check_brother_printer_main.py (new)",
|
|
"Non-goal: no assertion changed, no test deleted, skipped or weakened"
|
|
],
|
|
"changes": [
|
|
"test_consumables_part2.py split at TestCheckPageDelivery, which is exactly the MOD/MOD_PD boundary an earlier commit introduced. The two classes that needed MOD_PD move to test_page_delivery.py and use a plain MOD there, so the two-constant workaround dissolves rather than being carried forward: each file has one module under test again.",
|
|
"test_consumables.py split at TestEstimateConsumableLife: the state file and CUPS page-log tests stay, the life estimate and replacement resets go to test_consumable_estimate.py.",
|
|
"test_check_brother_printer.py split at TestMain: discovery and the network/USB mode selection stay, the CLI entry point and the reset flags go to test_check_brother_printer_main.py.",
|
|
"Renamed test_consumables_part2.py to test_counter_scales.py and narrowed its docstring, which had claimed to cover dropped-page detection that now lives in test_page_delivery.py."
|
|
],
|
|
"verification": [
|
|
{
|
|
"command": "PYTHONPATH=. python3 -m pytest python_pkg/brother_printer/tests -q",
|
|
"result": "pass",
|
|
"evidence": "402 passed - the same count as before the first of the eight commits in this package pass, so nothing was lost anywhere along the way."
|
|
},
|
|
{
|
|
"command": "PYTHONPATH=. python3 -m pytest python_pkg/brother_printer/tests -q (first run after the check_brother_printer split)",
|
|
"result": "fail then pass",
|
|
"evidence": "Reported 4 failed, 398 passed: TestResetConsumableFromPrinter travelled with TestMain and needed USBResult, which my hand-written import block had omitted. Added; the count returned to 402."
|
|
},
|
|
{
|
|
"command": "bash ~/utils/scripts/check_file_length.sh --all | grep brother_printer",
|
|
"result": "pass",
|
|
"evidence": "No output - python_pkg/brother_printer is entirely under the 250-line cap, down from fifteen violations at the start of the session."
|
|
},
|
|
{
|
|
"command": "pre-commit run --files <the touched test files and artifacts>",
|
|
"result": "pass",
|
|
"evidence": "ruff, ruff format, mypy, pylint, bandit, name-tests-test and pytest-with-coverage all pass."
|
|
}
|
|
],
|
|
"risks": [
|
|
"Hand-trimmed import blocks remain the recurring risk in test splits; this pass hit it three times and the pass-count check caught it every time. A test that was already skipped would not be caught this way, but the package has none.",
|
|
"Several test modules are now named after the private module they cover (_page_delivery, _pjl_io, _queue_fix). If a future split renames one of those source modules, the test file names go stale even though nothing breaks."
|
|
],
|
|
"rollback": [
|
|
"git revert the commit; the three originals return at 275, 272 and 273 lines and the three new modules disappear.",
|
|
"After rollback, re-run the package suite and confirm it still reports 402 passed."
|
|
]
|
|
}
|