77from hiero_sdk_python .file .file_append_transaction import FileAppendTransaction
88from hiero_sdk_python .file .file_contents_query import FileContentsQuery
99from hiero_sdk_python .file .file_create_transaction import FileCreateTransaction
10- from hiero_sdk_python .hbar import Hbar
1110from hiero_sdk_python .response_code import ResponseCode
1211from hiero_sdk_python .transaction .transaction import Transaction
1312from hiero_sdk_python .transaction .transaction_id import TransactionId
@@ -332,6 +331,7 @@ def test_file_append_chunk_transaction_can_execute_with_manual_freeze(env):
332331
333332@pytest .mark .integration
334333def test_serialize_chunked_file_append_transaction_can_be_executed (env ):
334+ """Test serilaize chunk file append transaction can be executed."""
335335 create_receipt = (
336336 FileCreateTransaction ()
337337 .set_keys (env .client .operator_private_key .public_key ())
@@ -345,28 +345,21 @@ def test_serialize_chunked_file_append_transaction_can_be_executed(env):
345345 file_contents = FileContentsQuery ().set_file_id (file_id ).execute (env .client )
346346 assert file_contents == b""
347347
348- content = "A" * ( 8192 ) # content with (8192/4096 ) bytes ie approx 2 chunks
348+ content = "A" * 20 # content with (20/10 ) bytes ie approx 2 chunks
349349
350- tx1 = (
351- FileAppendTransaction ()
352- .set_file_id (file_id )
353- .set_contents (content )
354- .freeze_with (env .client )
355- )
350+ tx1 = FileAppendTransaction ().set_file_id (file_id ).set_chunk_size (10 ).set_contents (content ).freeze_with (env .client )
356351
357- tx1 ._default_transaction_fee = Hbar .from_hbars (10 ).to_tinybars ()
358352 tx_bytes = tx1 .to_bytes ()
359353
360354 tx2 = Transaction .from_bytes (tx_bytes )
361355
362356 assert isinstance (tx2 , FileAppendTransaction )
363- assert tx2 .get_required_chunks () == 2
364357 assert len (tx2 ._transaction_ids ) == 2
365358 assert len (tx2 .node_account_ids ) == len (env .client .network .nodes )
366359
367360 receipt = tx2 .execute (env .client )
368361
369362 assert receipt .status == ResponseCode .SUCCESS
370-
363+
371364 file_contents = FileContentsQuery ().set_file_id (file_id ).execute (env .client )
372365 assert file_contents == bytes (content , "utf-8" )
0 commit comments