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
Adds __str__ to Suberror #218
Conversation
4fb2a9f
to
f3ae326
Compare
tests/test_resources.py
Outdated
@@ -932,6 +932,9 @@ def test_subscribe_multiple_errors(self): | |||
sub_errs = err.errors['subscription.account.account_code'] | |||
self.assertEqual(len(sub_errs), 2) | |||
self.assertEqual(type(sub_errs[1]), recurly.errors.ValidationError.Suberror) | |||
# make sure we aren't falling back to default Suberror string | |||
# represenation |
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.
typo
tests/test_resources.py
Outdated
@@ -932,6 +932,9 @@ def test_subscribe_multiple_errors(self): | |||
sub_errs = err.errors['subscription.account.account_code'] | |||
self.assertEqual(len(sub_errs), 2) | |||
self.assertEqual(type(sub_errs[1]), recurly.errors.ValidationError.Suberror) | |||
# make sure we aren't falling back to default Suberror string | |||
# represenation | |||
self.assertFalse("Suberror" in str(err)) |
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.
Positive asserts (checking the presence of a string) or much more robust than non-presence checks, maybe add one or two ?
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.
python2 and 3 arrange the keys in a different order. I'll add something to sort them first so they are consistent.
f3ae326
to
a4108d5
Compare
@pakal thanks for the comments. I am now sorting errors by key so the string representation is the same in python2 and python3. |
a4108d5
to
b98e23c
Compare
Resolves #217
b98e23c
to
3f39ab6
Compare
Resolves #217