-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Adding test coverage for render/glyph.py mark ii #1566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
obfuscurity
merged 10 commits into
graphite-project:master
from
cbowman0:coverage_render_glyph
Jul 1, 2016
Merged
Adding test coverage for render/glyph.py mark ii #1566
obfuscurity
merged 10 commits into
graphite-project:master
from
cbowman0:coverage_render_glyph
Jul 1, 2016
Conversation
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
Bug Fixes: * Add some defensive input checks in find_x_times and format_units * Explicitly define self.span and self.binary in class _LinearAxisTics. It was being defined in method calls. Standalone functions: * Tests for format_units() * Tests for find_x_times() * Tests for toSeconds() * Tests for sort_stacked() * Tests for safeArgs() * Tests for safeMin() * Tests for safeMax() * Tests for safeSum() * Tests for any() Classes: * Tests for the _LinearAxisTics Class * Tests for the _LogAxisTics Class
It was not being set to None if the axisLimit argument was positive infinity.
Move the (minValue < maxValue) check to reconcileLimits().
Methods checkFinite() and chooseDelta() are static and defined only in _AxisTics, so 1. An instance doesn't have to be generated to test them. 2. They can be tested once, rather than once for _LinearAxisTics and once for _LogAxisTics.
This method is meant to be called via applySettings(), not directly. So call applySettings() in each test rather than reconcileLimits(). Check its results by looking at y.minValue and y.maxValue. And add some more tests covering cases where it really has to do some work.
As a bonus, using zip() makes the code a bit shorter.
Member
Author
Current coverage is 51.01%@@ master #1566 diff @@
==========================================
Files 52 52
Lines 5796 5808 +12
Methods 0 0
Messages 0 0
Branches 1120 1123 +3
==========================================
+ Hits 2756 2963 +207
+ Misses 2833 2635 -198
- Partials 207 210 +3
|
Member
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.



Code Enhancements:
Standalone functions:
Classes: