Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add subscriptions#240

Merged
t8y8 merged 10 commits intotableau:developmenttableau/server-client-python:developmentfrom
williamlang:add-subscriptionswilliamlang/server-client-python:add-subscriptionsCopy head branch name to clipboard
Oct 9, 2017
Merged

Add subscriptions#240
t8y8 merged 10 commits intotableau:developmenttableau/server-client-python:developmentfrom
williamlang:add-subscriptionswilliamlang/server-client-python:add-subscriptionsCopy head branch name to clipboard

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.