-
Notifications
You must be signed in to change notification settings - Fork 295
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
Increase the test coverage of maps.py in test_maps.py #603
Conversation
…ose to 100% as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this - this is very needed.
But the unit tests are failing. Can you please take a look at the unit test results on this PR? It may help you to run the tests locally first to ensure that the tests aren't failing when you push to the PR. Please let me know if you have any questions - thank you!
tests/test_maps.py
Outdated
values = [1, 2, 3, 4, 5] | ||
ids = ['id1', 'id2', 'id3'] | ||
colored = states.color(values, ids) | ||
assert ids == list(range(len(values))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we please just list the final value we expect rather than copying the logic from the source code?
} | ||
region = ds.Region(geojson_data) | ||
# Call the geojson method with a new feature_id | ||
updated_geojson = region.geojson("new_id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the new id named "test_id" above? Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't understand the code earlier, makes sense now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After making the requested changes myself, this now looks good to me. But since I've done non-trivial work on this PR, I'd request @davidwagner to please review this first. I'll try to fill in the remaining untested code in a separate PR once this merges.
} | ||
region = ds.Region(geojson_data) | ||
# Call the geojson method with a new feature_id | ||
updated_geojson = region.geojson("new_id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't understand the code earlier, makes sense now.
This looks good to me! Thank you. I appreciate all the tests and the bugfix in Map.read_geojson(). (Side note: I never noticed the semantics of Map.overlay(Map) before...) |
@adnanhemani Merged. Thank you for the review! |
[x] Wrote test for feature
[ ] Added changes to CHANGELOG.md
[ ] Bumped version number (delete if unneeded)
Changes proposed:
Try to increase the test coverage of maps.py to as close to 100% as possible.