File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
tableauserverclient/server/endpoint Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,13 @@ def update(self, site_item):
6767 error = 'You cannot set admin_mode to ContentOnly and also set a user quota'
6868 raise ValueError (error )
6969
70+ if site_item .user_quota :
71+ if any ([site_item .tier_creator_capacity ,
72+ site_item .tier_explorer_capacity ,
73+ site_item .tier_viewer_capacity , ]):
74+ error = 'You cannot set tiered capacity and a user quota.'
75+ raise ValueError (error )
76+
7077 url = "{0}/{1}" .format (self .baseurl , site_item .id )
7178 update_req = RequestFactory .Site .update_req (site_item )
7279 server_response = self .put_request (url , update_req )
Original file line number Diff line number Diff line change @@ -156,3 +156,18 @@ def test_decrypt(self):
156156 with requests_mock .mock () as m :
157157 m .post (self .baseurl + '/0626857c-1def-4503-a7d8-7907c3ff9d9f/decrypt-extracts' , status_code = 200 )
158158 self .server .sites .decrypt_extracts ('0626857c-1def-4503-a7d8-7907c3ff9d9f' )
159+
160+ def test_quota_and_tiers_error (self ):
161+ with open (UPDATE_XML , 'rb' ) as f :
162+ response_xml = f .read ().decode ('utf-8' )
163+ with requests_mock .mock () as m :
164+ m .put (self .baseurl + '/6b7179ba-b82b-4f0f-91ed-812074ac5da6' , text = response_xml )
165+ single_site = TSC .SiteItem (name = 'Tableau' , content_url = 'tableau' ,
166+ admin_mode = TSC .SiteItem .AdminMode .ContentAndUsers ,
167+ user_quota = 15 , storage_quota = 1000 ,
168+ disable_subscriptions = True , revision_history_enabled = False ,
169+ data_acceleration_mode = 'disable' )
170+ single_site .tier_creator_capacity = 11
171+ single_site ._id = '6b7179ba-b82b-4f0f-91ed-812074ac5da6'
172+ with self .assertRaises (ValueError ):
173+ single_site = self .server .sites .update (single_site )
You can’t perform that action at this time.
0 commit comments