Skip to content

Commit

Permalink
Fix Pager by making UserItem return a list like the other models (#109)
Browse files Browse the repository at this point in the history
Fixes #107
  • Loading branch information
t8y8 committed Dec 2, 2016
1 parent e853d7c commit c0c31cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tableauserverclient/models/user_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _set_values(self, id, name, site_role, last_login,

@classmethod
def from_response(cls, resp):
all_user_items = set()
all_user_items = []
parsed_response = ET.fromstring(resp)
all_user_xml = parsed_response.findall('.//t:user', namespaces=NAMESPACE)
for user_xml in all_user_xml:
Expand All @@ -128,7 +128,7 @@ def from_response(cls, resp):
user_item = cls(name, site_role)
user_item._set_values(id, name, site_role, last_login, external_auth_user_id,
fullname, email, auth_setting, domain_name)
all_user_items.add(user_item)
all_user_items.append(user_item)
return all_user_items

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion test/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_get_empty(self):
all_users, pagination_item = self.server.users.get()

self.assertEqual(0, pagination_item.total_available)
self.assertEqual(set(), all_users)
self.assertEqual([], all_users)

def test_get_before_signin(self):
self.server._auth_token = None
Expand Down

0 comments on commit c0c31cc

Please sign in to comment.