@@ -55,7 +55,9 @@ def test_convert_file_part_with_uri(self):
5555 a2a_part = a2a_types .Part (
5656 root = a2a_types .FilePart (
5757 file = a2a_types .FileWithUri (
58- uri = "gs://bucket/file.txt" , mime_type = "text/plain"
58+ uri = "gs://bucket/file.txt" ,
59+ mime_type = "text/plain" ,
60+ name = "my_file.txt" ,
5961 )
6062 )
6163 )
@@ -69,6 +71,7 @@ def test_convert_file_part_with_uri(self):
6971 assert result .file_data is not None
7072 assert result .file_data .file_uri == "gs://bucket/file.txt"
7173 assert result .file_data .mime_type == "text/plain"
74+ assert result .file_data .display_name == "my_file.txt"
7275
7376 def test_convert_file_part_with_bytes (self ):
7477 """Test conversion of A2A FilePart with bytes to GenAI Part."""
@@ -80,7 +83,9 @@ def test_convert_file_part_with_bytes(self):
8083 a2a_part = a2a_types .Part (
8184 root = a2a_types .FilePart (
8285 file = a2a_types .FileWithBytes (
83- bytes = base64_encoded , mime_type = "text/plain"
86+ bytes = base64_encoded ,
87+ mime_type = "text/plain" ,
88+ name = "my_bytes.txt" ,
8489 )
8590 )
8691 )
@@ -95,6 +100,7 @@ def test_convert_file_part_with_bytes(self):
95100 # The converter decodes base64 back to original bytes
96101 assert result .inline_data .data == test_bytes
97102 assert result .inline_data .mime_type == "text/plain"
103+ assert result .inline_data .display_name == "my_bytes.txt"
98104
99105 def test_convert_data_part_function_call (self ):
100106 """Test conversion of A2A DataPart with function call metadata."""
@@ -296,7 +302,9 @@ def test_convert_file_data_part(self):
296302 # Arrange
297303 genai_part = genai_types .Part (
298304 file_data = genai_types .FileData (
299- file_uri = "gs://bucket/file.txt" , mime_type = "text/plain"
305+ file_uri = "gs://bucket/file.txt" ,
306+ mime_type = "text/plain" ,
307+ display_name = "my_file.txt" ,
300308 )
301309 )
302310
@@ -310,13 +318,18 @@ def test_convert_file_data_part(self):
310318 assert isinstance (result .root .file , a2a_types .FileWithUri )
311319 assert result .root .file .uri == "gs://bucket/file.txt"
312320 assert result .root .file .mime_type == "text/plain"
321+ assert result .root .file .name == "my_file.txt"
313322
314323 def test_convert_inline_data_part (self ):
315324 """Test conversion of GenAI inline_data Part to A2A Part."""
316325 # Arrange
317326 test_bytes = b"test file content"
318327 genai_part = genai_types .Part (
319- inline_data = genai_types .Blob (data = test_bytes , mime_type = "text/plain" )
328+ inline_data = genai_types .Blob (
329+ data = test_bytes ,
330+ mime_type = "text/plain" ,
331+ display_name = "my_bytes.txt" ,
332+ )
320333 )
321334
322335 # Act
@@ -332,6 +345,7 @@ def test_convert_inline_data_part(self):
332345 expected_base64 = base64 .b64encode (test_bytes ).decode ("utf-8" )
333346 assert result .root .file .bytes == expected_base64
334347 assert result .root .file .mime_type == "text/plain"
348+ assert result .root .file .name == "my_bytes.txt"
335349
336350 def test_convert_inline_data_part_with_video_metadata (self ):
337351 """Test conversion of GenAI inline_data Part with video metadata to A2A Part."""
0 commit comments