Skip to content

Commit 183e985

Browse files
committed
chore: use workbook setter in tests
1 parent eb2df3f commit 183e985

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/test_custom_view.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ def test_publish_filepath(server: TSC.Server) -> None:
174174
cv = TSC.CustomViewItem(name="test")
175175
cv._owner = TSC.UserItem()
176176
cv._owner._id = "dd2239f6-ddf1-4107-981a-4cf94e415794"
177-
cv._workbook = TSC.WorkbookItem()
178-
cv._workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
177+
cv.workbook = TSC.WorkbookItem()
178+
cv.workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
179179
with requests_mock.mock() as m:
180180
m.post(server.custom_views.expurl, status_code=201, text=GET_XML.read_text())
181181
view = server.custom_views.publish(cv, CUSTOM_VIEW_DOWNLOAD)
@@ -190,8 +190,8 @@ def test_publish_file_str(server: TSC.Server) -> None:
190190
cv = TSC.CustomViewItem(name="test")
191191
cv._owner = TSC.UserItem()
192192
cv._owner._id = "dd2239f6-ddf1-4107-981a-4cf94e415794"
193-
cv._workbook = TSC.WorkbookItem()
194-
cv._workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
193+
cv.workbook = TSC.WorkbookItem()
194+
cv.workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
195195
with requests_mock.mock() as m:
196196
m.post(server.custom_views.expurl, status_code=201, text=GET_XML.read_text())
197197
view = server.custom_views.publish(cv, str(CUSTOM_VIEW_DOWNLOAD))
@@ -206,8 +206,8 @@ def test_publish_file_io(server: TSC.Server) -> None:
206206
cv = TSC.CustomViewItem(name="test")
207207
cv._owner = TSC.UserItem()
208208
cv._owner._id = "dd2239f6-ddf1-4107-981a-4cf94e415794"
209-
cv._workbook = TSC.WorkbookItem()
210-
cv._workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
209+
cv.workbook = TSC.WorkbookItem()
210+
cv.workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
211211
data = io.BytesIO(CUSTOM_VIEW_DOWNLOAD.read_bytes())
212212
with requests_mock.mock() as m:
213213
m.post(server.custom_views.expurl, status_code=201, text=GET_XML.read_text())
@@ -222,8 +222,8 @@ def test_publish_file_io(server: TSC.Server) -> None:
222222
def test_publish_missing_owner_id(server: TSC.Server) -> None:
223223
cv = TSC.CustomViewItem(name="test")
224224
cv._owner = TSC.UserItem()
225-
cv._workbook = TSC.WorkbookItem()
226-
cv._workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
225+
cv.workbook = TSC.WorkbookItem()
226+
cv.workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
227227
with requests_mock.mock() as m:
228228
m.post(server.custom_views.expurl, status_code=201, text=GET_XML.read_text())
229229
with pytest.raises(ValueError):
@@ -234,7 +234,7 @@ def test_publish_missing_wb_id(server: TSC.Server) -> None:
234234
cv = TSC.CustomViewItem(name="test")
235235
cv._owner = TSC.UserItem()
236236
cv._owner._id = "dd2239f6-ddf1-4107-981a-4cf94e415794"
237-
cv._workbook = TSC.WorkbookItem()
237+
cv.workbook = TSC.WorkbookItem()
238238
with requests_mock.mock() as m:
239239
m.post(server.custom_views.expurl, status_code=201, text=GET_XML.read_text())
240240
with pytest.raises(ValueError):
@@ -245,8 +245,8 @@ def test_large_publish(server: TSC.Server):
245245
cv = TSC.CustomViewItem(name="test")
246246
cv._owner = TSC.UserItem()
247247
cv._owner._id = "dd2239f6-ddf1-4107-981a-4cf94e415794"
248-
cv._workbook = TSC.WorkbookItem()
249-
cv._workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
248+
cv.workbook = TSC.WorkbookItem()
249+
cv.workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
250250
with ExitStack() as stack:
251251
temp_dir = stack.enter_context(TemporaryDirectory())
252252
file_path = Path(temp_dir) / "test_file"

0 commit comments

Comments
 (0)