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(
180180 )
181181 blob = self .bucket .blob (blob_name )
182182
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." )
187194
188195 return version
189196
Original file line number Diff line number Diff line change @@ -258,8 +258,9 @@ async def test_list_versions(service_type):
258258 )
259259 for i in range (3 )
260260 ]
261+ versions .append (types .Part .from_text (text = "hello" ))
261262
262- for i in range (3 ):
263+ for i in range (4 ):
263264 await artifact_service .save_artifact (
264265 app_name = app_name ,
265266 user_id = user_id ,
@@ -275,4 +276,4 @@ async def test_list_versions(service_type):
275276 filename = filename ,
276277 )
277278
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