Skip to content
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

Refactor PrefixMap and PrefixList validation for clarity #956

Merged
merged 2 commits into from
Mar 25, 2020

Conversation

mdickinson
Copy link
Member

@mdickinson mdickinson commented Mar 23, 2020

This PR refactors the PrefixMap.validate and PrefixList.validate methods for simplicity, clarity and consistency with each other.

Along the way, it fixes #955 and #957.

Additional tests on the way. No API changes, so no documentation updates or stub updates needed. Tests added. I didn't add a regression test specifically for #955 (the nested exception) since I don't think we should ever really care much in code whether an exception arises from another one; it's more of a cosmetic issue for those seeing the exception.

@mdickinson mdickinson requested a review from midhun-pm March 23, 2020 10:55
@@ -47,8 +48,14 @@ class Person(HasTraits):
with self.assertRaises(TraitError):
person.married = "ye"

with self.assertRaises(TraitError):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed because this is now covered in the test_bad_types test.

Copy link
Contributor

@midhun-pm midhun-pm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a lot cleaner. Thanks!

@mdickinson mdickinson merged commit de2eaa2 into master Mar 25, 2020
@mdickinson mdickinson deleted the refactor/prefix-map-and-prefix-list branch March 25, 2020 08:06
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.

Nested exceptions from failed PrefixList validation.
2 participants