@@ -173,43 +173,6 @@ async def test_multiple_files_in_message(self):
173173 )
174174 assert result .parts [4 ].file_data .display_name == "file2.jpg"
175175
176- @pytest .mark .asyncio
177- async def test_unsupported_canonical_uri_keeps_inline_data (self ):
178- """Fallback to inline data when artifact URI is not model-accessible."""
179- inline_data = types .Blob (
180- display_name = "local_only.png" ,
181- data = b"image data" ,
182- mime_type = "image/png" ,
183- )
184-
185- artifact_service = self .mock_context .artifact_service
186- original_side_effect = artifact_service .get_artifact_version .side_effect
187-
188- async def _memory_only_version (** kwargs ):
189- return ArtifactVersion (
190- version = kwargs .get ("version" , 0 ),
191- canonical_uri = (
192- "memory://apps/test_app/users/test_user/sessions/test_session/"
193- "artifacts/local_only.png/versions/0"
194- ),
195- mime_type = "image/png" ,
196- )
197-
198- artifact_service .get_artifact_version .side_effect = _memory_only_version
199-
200- try :
201- user_message = types .Content (parts = [types .Part (inline_data = inline_data )])
202- result = await self .plugin .on_user_message_callback (
203- invocation_context = self .mock_context , user_message = user_message
204- )
205-
206- assert result
207- assert len (result .parts ) == 2
208- assert result .parts [0 ].text == '[Uploaded Artifact: "local_only.png"]'
209- assert result .parts [1 ].inline_data == inline_data
210- finally :
211- artifact_service .get_artifact_version .side_effect = original_side_effect
212-
213176 @pytest .mark .asyncio
214177 async def test_no_artifact_service (self ):
215178 """Test behavior when artifact service is not available."""
0 commit comments