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

Adds __str__ to Suberror #218

Merged
merged 1 commit into from Dec 6, 2017
Merged

Adds __str__ to Suberror #218

merged 1 commit into from Dec 6, 2017

Conversation

bhelx
Copy link
Contributor

@bhelx bhelx commented Oct 27, 2017

Resolves #217

@@ -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
Copy link

Choose a reason for hiding this comment

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

typo

@@ -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))
Copy link

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 ?

Copy link
Contributor Author

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.

@bhelx
Copy link
Contributor Author

bhelx commented Nov 28, 2017

@pakal thanks for the comments. I am now sorting errors by key so the string representation is the same in python2 and python3.

@bhelx bhelx merged commit b581cec into master Dec 6, 2017
@aaron-junot aaron-junot deleted the add_str_to_suberror branch September 25, 2018 16:52
@bhelx bhelx added the V2 V2 Client label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V2 V2 Client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ValidationError.Suberror doesn't have proper python3 stringification
2 participants