8000 added materialized views for update workbook/site tests, changed get_… · SnarkyPapi/server-client-python@699a982 · GitHub
[go: up one dir, main page]

Skip to content

Commit 699a982

Browse files
author
bzhang
committed
added materialized views for update workbook/site tests, changed get_by_content_url to correct rest api version
1 parent 3a15b0c commit 699a982

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

tableauserverclient/server/endpoint/sites_endpoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def get_by_name(self, site_name):
4545
return SiteItem.from_response(server_response.content, self.parent_srv.namespace)[0]
4646

4747
# Gets 1 site by content url
48-
@api(version="3.3")
48+
@api(version="2.0")
4949
def get_by_content_url(self, content_url):
5050
if content_url is None:
5151
error = "Content URL undefined."

test/assets/site_update.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-2.3.xsd">
3-
<site id="6b7179ba-b82b-4f0f-91ed-812074ac5da6" name="Tableau" contentUrl="tableau" adminMode="ContentAndUsers" userQuota="15" disableSubscriptions="true" state="Suspended" revisionHistoryEnabled="true" subscribeOthersEnabled="true" revisionLimit="13"/>
3+
<site id="6b7179ba-b82b-4f0f-91ed-812074ac5da6" name="Tableau" contentUrl="tableau" adminMode="ContentAndUsers" userQuota="15" disableSubscriptions="true" state="Suspended" revisionHistoryEnabled="true" subscribeOthersEnabled="true" revisionLimit="13" materializedViewsEnabled="true"/>
44
</tsResponse>

test/assets/workbook_update.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-2.3.xsd">
3-
<workbook id="1f951daf-4061-451a-9df1-69a8062664f2" name="renamedWorkbook" contentUrl="RESTAPISample" showTabs="true" size="1" createdAt="2016-08-18T18:25:36Z" updatedAt="2016-08-18T18:29:36Z">
3+
<workbook id="1f951daf-4061-451a-9df1-69a8062664f2" name="renamedWorkbook" contentUrl="RESTAPISample" showTabs="true" size="1" createdAt="2016-08-18T18:25:36Z" updatedAt="2016-08-18T18:29:36Z" materializedViewsEnabled="true">
44
<project id="1d0304cd-3796-429f-b815-7258370b9b74" name="Tableau" />
55
<owner id="dd2239f6-ddf1-4107-981a-4cf94e415794" />
66
<tags />

test/test_site.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def test_update(self):
105105
self.assertEqual(13, single_site.revision_limit)
106106
self.assertEqual(True, single_site.disable_subscriptions)
107107
self.assertEqual(15, single_site.user_quota)
108+
self.assertEqual(True, single_site.materialized_views_enabled)
108109

109110
def test_update_missing_id(self):
110111
single_site = TSC.SiteItem('test', 'test')

test/test_workbook.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,15 @@ def test_update(self):
119119
single_workbook._id = '1f951daf-4061-451a-9df1-69a8062664f2'
120120
single_workbook.owner_id = 'dd2239f6-ddf1-4107-981a-4cf94e415794'
121121
single_workbook.name = 'renamedWorkbook'
122+
single_workbook.materialized_views_enabled = True
122123
single_workbook = self.server.workbooks.update(single_workbook)
123124

124125
self.assertEqual('1f951daf-4061-451a-9df1-69a8062664f2', single_workbook.id)
125126
self.assertEqual(True, single_workbook.show_tabs)
126127
self.assertEqual('1d0304cd-3796-429f-b815-7258370b9b74', single_workbook.project_id)
127128
self.assertEqual('dd2239f6-ddf1-4107-981a-4cf94e415794', single_workbook.owner_id)
128129
self.assertEqual('renamedWorkbook', single_workbook.name)
130+
self.assertEqual(True, single_workbook.materialized_views_enabled)
129131

130132
def test_update_missing_id(self):
131133
single_workbook = TSC.WorkbookItem('test')

0 commit comments

Comments
 (0)
0