Add subscriptions#240
Merged
t8y8 merged 10 commits intotableau:developmenttableau/server-client-python:developmentfrom Oct 9, 2017
williamlang:add-subscriptionswilliamlang/server-client-python:add-subscriptionsCopy head branch name to clipboard
Merged
Add subscriptions#240t8y8 merged 10 commits intotableau:developmenttableau/server-client-python:developmentfrom williamlang:add-subscriptionswilliamlang/server-client-python:add-subscriptionsCopy head branch name to clipboard
t8y8 merged 10 commits intotableau:developmenttableau/server-client-python:developmentfrom
williamlang:add-subscriptionswilliamlang/server-client-python:add-subscriptionsCopy head branch name to clipboard
Conversation
t8y8
approved these changes
Oct 6, 2017
Collaborator
t8y8
left a comment
There was a problem hiding this comment.
🚀
A couple of minor nits then LGTM
| all_subscriptions_xml = parsed_response.findall( | ||
| './/t:subscription', namespaces=ns) | ||
|
|
||
| all_subscriptions = (SubscriptionItem._parse_element(x, ns) for x in all_subscriptions_xml) |
Collaborator
There was a problem hiding this comment.
Just make this a list comprehension since you listify it anyway.
| server_response = self.get_request(url, req_options) | ||
|
|
||
| pagination_item = PaginationItem.from_response(server_response.content, self.parent_srv.namespace) | ||
| print(server_response.content) |
| id_ = element.get('id', None) | ||
| subject = element.get('subject', None) | ||
| sub = cls(subject, schedule_id, user_id, target) | ||
| sub._set_id(id_) |
Collaborator
There was a problem hiding this comment.
Why do you have the id only settable via a private method? (If other Items do this to it's fine, just asking).
The other attributes are all available via __init__.
Author
There was a problem hiding this comment.
modeled it after the UserItem -- because when creating a new User you don't have an id.
Same goes for Subscription.
test/test_subscription.py
Outdated
| self.assertEqual('Not Found Alert', subscription.subject) | ||
| self.assertEqual('7617c389-cdca-4940-a66e-69956fcebf3e', subscription.schedule_id) | ||
|
|
||
| def test_get_single_subscription(self): |
Collaborator
|
🚀 |
Collaborator
|
@RussTheAerialist says 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adding subscriptions!