-
Notifications
You must be signed in to change notification settings - Fork 714
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
Api v3 client - ASM Groups endpoint #123
Api v3 client - ASM Groups endpoint #123
Conversation
Api v3 client - ASM Groups endpoint
if len(id) > 1: | ||
count = 0 | ||
for i in id: | ||
if count == 0: |
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.
I believe the pythonic way of writing this would be self._endpoint = self._endpoint + "?id=" + str(i) if count == 0 else self._endpoint + "&id=" + str(i)
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.
Or simply
self._endpoint += '?%s' % '&'.join('id=%s' % i for i in id)
Or using a proper library function, like urlquote.
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.
Yep! That works too
This adds the ASM groups endpoint and refactors the tests for better reusability.