Raise test coverage from 73% to 84% - #10
Open
SoundGoof wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
make coveragein a Python 2.7 container, since this repo doesn't run under Python 3)tests/TestStatistics.pyandtests/TestDiff.py, coveringlib/statistics.pyandlib/diff.py(previously untested, 0%)tests/TestFirewall.pywith explicit-option (s=/c=/w=/l=/p=), version-suffix, flow-prefix, and error-path tests, takinglib/firewall.pyto 100%tests/TestSeatmap.py, takinglib/location.pyto 99%9ca1d4d("remove padding on vertical rows") also silently dropped theeven()rounding call inlocation.switch_locationsfor 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 updatedTestSeatmap's expected values to match, which also fixesTestSeatmap.testSwitchLocationWithMixedLayout, which was failing on master.Test plan
make coveragepasses clean (exit 0) in apython:2.7container, 73% → 84% totallib/diff.py,lib/statistics.py,lib/firewall.pyat 100%;lib/location.pyat 99% (remaining line is a trailingcontinuethat CPython/coverage.py can't trace as a separate line, not an actual gap)TestSeatmap.testSwitchLocationWithMixedLayout