8000 Add subscriptions by williamlang · Pull Request #240 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

Add subscriptions #240

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

Merged
merged 10 commits into from
Oct 9, 2017
Merged

Add subscriptions #240

merged 10 commits into from
Oct 9, 2017

Conversation

williamlang
Copy link

Adding subscriptions!

Copy link
Collaborator
@t8y8 t8y8 left a comment

Choose a reason for hiding this comment

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

🚀

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

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

remove the debug print :)

id_ = element.get('id', None)
subject = element.get('subject', None)
sub = cls(subject, schedule_id, user_id, target)
sub._set_id(id_)
Copy link
Collaborator

Choose a reason for hiding this comment

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

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__.

Copy link
Author

Choose a reason for hiding this comment

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

modeled it after the UserItem -- because when creating a new User you don't have an id.

Same goes for Subscription.

self.assertEqual('Not Found Alert', subscription.subject)
self.assertEqual('7617c389-cdca-4940-a66e-69956fcebf3e', subscription.schedule_id)

def test_get_single_subscription(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

test_get_subscription_by_id

@t8y8
Copy link
Collaborator
t8y8 commented Oct 6, 2017

🚀

@t8y8
Copy link
Collaborator
t8y8 commented Oct 9, 2017

@RussTheAerialist says 🚀

@t8y8 t8y8 merged commit 262d32f into tableau:development Oct 9, 2017
@williamlang williamlang deleted the add-subscriptions branch October 31, 2017 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0