-
Notifications
You must be signed in to change notification settings - Fork 59
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
New function validate-invariants #928
New function validate-invariants #928
Conversation
…unction-check-invariants
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.
@sarahsonder you're definitely on the right track here! In addition to writing tests (of course), my main comment is you've correctly found some existing code on which to base you work. But now that you've done so, the best approach is to refactor your code to remove the duplication, so that the common code is used in existing place and in the new function you've added. This might mean defining new helper methods as appropriate.
Pull Request Test Coverage Report for Build 5663898953
💛 - Coveralls |
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.
@sarahsonder good work. I left some inline comments, but also make sure to add this new function to the contract checking documentation page.
Motivation and Context
To explicitly check that the representation invariants of an object are satisfied.
Your Changes
Description:
Created a new function called
validate_invariants
which takes in an objectobj
and checks that the representation invariants ofobj
are satifised.Type of change
Testing
Created testing suite
test_validate_invariants.py
.Checklist