Skip to content

Raise test coverage from 73% to 84% - #10

Open
SoundGoof wants to merge 1 commit into
masterfrom
improve-test-coverage
Open

Raise test coverage from 73% to 84%#10
SoundGoof wants to merge 1 commit into
masterfrom
improve-test-coverage

Conversation

@SoundGoof

Copy link
Copy Markdown
Member

Summary

  • Raise overall test coverage from 73% to 84% (verified via make coverage in a Python 2.7 container, since this repo doesn't run under Python 3)
  • Add tests/TestStatistics.py and tests/TestDiff.py, covering lib/statistics.py and lib/diff.py (previously untested, 0%)
  • Extend tests/TestFirewall.py with explicit-option (s=/c=/w=/l=/p=), version-suffix, flow-prefix, and error-path tests, taking lib/firewall.py to 100%
  • Add a hall-position test to tests/TestSeatmap.py, taking lib/location.py to 99%
  • Fix a real, pre-existing bug: 9ca1d4d ("remove padding on vertical rows") also silently dropped the even() rounding call in location.switch_locations for both branches, not just the padding it described — multi-table (scaled) layouts were producing fractional pixel coordinates for switches instead of rounded-even integers. Restored the rounding and updated TestSeatmap's expected values to match, which also fixes TestSeatmap.testSwitchLocationWithMixedLayout, which was failing on master.

Test plan

  • make coverage passes clean (exit 0) in a python:2.7 container, 73% → 84% total
  • lib/diff.py, lib/statistics.py, lib/firewall.py at 100%; lib/location.py at 99% (remaining line is a trailing continue that CPython/coverage.py can't trace as a separate line, not an actual gap)
  • All existing tests still pass, including the previously-broken TestSeatmap.testSwitchLocationWithMixedLayout

Add TestStatistics.py and TestDiff.py, covering lib/statistics.py and
lib/diff.py (previously 0%). Add explicit-option and error-path tests
to TestFirewall.py, taking lib/firewall.py to 100%. Add a hall-position
test to TestSeatmap.py, taking lib/location.py to 99%.

Also fixes a real, pre-existing test failure: 9ca1d4d dropped the
even() rounding call in location.switch_locations for both branches
(not just the padding it described), so multi-table layouts produced
fractional switch coordinates. Restored the rounding and updated the
test's expected values to match.
@SoundGoof
SoundGoof requested a review from furest July 26, 2026 18:20
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