You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classGitHub(uplink.Consumer):
@uplink.get("/users/{username}")defget_user(self, username):
"""Get a single user."""
Use any method annotation. For this example, I'll create a custom method annotation, PrintMethodName, that simply prints the name of the consumer method that it wraps:
The root cause here is that uplink.helpers.get_api_definitions returns all consumer methods available to the given class -- including those inherited through the class hierarchy. Any fix for this issue should include a unit test that verifies that MethodAnnotations strictly decorates consumer methods defined in the decorated consumer's body.
Precondition
Consider the following consumer class:
Use any method annotation. For this example, I'll create a custom method annotation,
PrintMethodName
, that simply prints the name of the consumer method that it wraps:Steps to recreate
Create a subclass of
GitHub
and decorate it with the method annotation:Expected
No output to stdout, since
GitHubSubclass
doesn't define any consumer methods.Actual
The method annotation decorates
get_user
from the parent class,GitHub
.Output:
get_user
The text was updated successfully, but these errors were encountered: