Generate explicit nested resource class methods #1050
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replaces
@nested_resource_class_methods
decorator with explicit method definitions. This will make things easier to type.To make this truly a no-op, we need to preserve the "helper" methods like
stripe.Customer.balance_transactions_url
andstripe.Customer.balance_transactions_request
, even though we are no longer using them. Hence, we leave the@nested_resource_class_methods
decorator in without any operations to provide these methods.Testing
How can we be sure this doesn't change any behavior?
I have a little test script I added in Test nested resources that I ran both with and without the change.
(240 = 40 nested methods * 2 log statements * 3 test cases each)
This ~proves that, though there are a few differences in terms of whether the data is on the params dictionary or whether it is taken off via
util.read_special_variable
the behavior of everything is the same once it gets to api_requestor.