File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
tests/unittests/artifacts Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -180,10 +180,17 @@ def _save_artifact(
180
180
)
181
181
blob = self .bucket .blob (blob_name )
182
182
183
- blob .upload_from_string (
184
- data = artifact .inline_data .data ,
185
- content_type = artifact .inline_data .mime_type ,
186
- )
183
+ if artifact .inline_data :
184
+ blob .upload_from_string (
185
+ data = artifact .inline_data .data ,
186
+ content_type = artifact .inline_data .mime_type ,
187
+ )
188
+ elif artifact .text :
189
+ blob .upload_from_string (
190
+ data = artifact .text ,
191
+ )
192
+ else :
193
+ raise ValueError ("Artifact must have either inline_data or text." )
187
194
188
195
return version
189
196
Original file line number Diff line number Diff line change @@ -258,8 +258,9 @@ async def test_list_versions(service_type):
258
258
)
259
259
for i in range (3 )
260
260
]
261
+ versions .append (types .Part .from_text (text = "hello" ))
261
262
262
- for i in range (3 ):
263
+ for i in range (4 ):
263
264
await artifact_service .save_artifact (
264
265
app_name = app_name ,
265
266
user_id = user_id ,
@@ -275,4 +276,4 @@ async def test_list_versions(service_type):
275
276
filename = filename ,
276
277
)
277
278
278
- assert response_versions == list (range (3 ))
279
+ assert response_versions == list (range (4 ))
You can’t perform that action at this time.
0 commit comments