44
55from hiero_sdk_python .account .account_create_transaction import AccountCreateTransaction
66from hiero_sdk_python .account .account_id import AccountId
7+ from hiero_sdk_python .consensus .topic_id import TopicId
8+ from hiero_sdk_python .consensus .topic_message_submit_transaction import TopicMessageSubmitTransaction
79from hiero_sdk_python .crypto .private_key import PrivateKey
810from hiero_sdk_python .exceptions import ReceiptStatusError
911from hiero_sdk_python .file .file_append_transaction import FileAppendTransaction
3335
3436@pytest .fixture
3537def file_id ():
36- """Returns a file_is for test."""
38+ """Returns a file_id for test."""
3739 return FileId .from_string ("0.0.1" )
3840
3941
@@ -301,8 +303,8 @@ def test_tx_without_optional_fields_should_have_smaller_tx_body(
301303 assert tx1 .body_size < tx2 .body_size
302304
303305
304- def test_chunk_tx_should_return_list_of_body_sizes (file_id , account_id , transaction_id ):
305- """Test should return array of body sizes for multi-chunk transaction."""
306+ def test_file_append_chunk_tx_should_return_list_of_body_sizes (file_id , account_id , transaction_id ):
307+ """Test file append tx should return array of body sizes for multi-chunk transaction."""
306308 chunk_size = 1024
307309 content = "a" * (chunk_size * 3 )
308310
@@ -321,8 +323,8 @@ def test_chunk_tx_should_return_list_of_body_sizes(file_id, account_id, transact
321323 assert len (sizes ) == 3
322324
323325
324- def test_single_chunk_tx_return_list_of_len_one (file_id , account_id , transaction_id ):
325- """Test should return array of one size for single-chunk transaction."""
326+ def test_file_append_single_chunk_tx_return_list_of_len_one (file_id , account_id , transaction_id ):
327+ """Test file append tx should return array of one size for single-chunk transaction."""
326328 content = "small_content"
327329 tx = (
328330 FileAppendTransaction ()
@@ -338,6 +340,43 @@ def test_single_chunk_tx_return_list_of_len_one(file_id, account_id, transaction
338340 assert len (sizes ) == 1
339341
340342
343+ def test_message_submit_chunk_tx_should_return_list_of_body_sizes (topic_id , account_id , transaction_id ):
344+ """Test topic message submit tx should return array of body sizes for multi-chunk transaction."""
345+ chunk_size = 1024
346+ message = "a" * (chunk_size * 3 )
347+
348+ tx = (
349+ TopicMessageSubmitTransaction ()
350+ .set_topic_id (topic_id )
351+ .set_chunk_size (chunk_size )
352+ .set_message (message )
353+ .set_transaction_id (transaction_id )
354+ .set_node_account_id (account_id )
355+ .freeze ()
356+ )
357+
358+ sizes = tx .body_size_all_chunks
359+ assert isinstance (sizes , list )
360+ assert len (sizes ) == 3
361+
362+
363+ def test_message_submit_single_chunk_tx_return_list_of_len_one (topic_id , account_id , transaction_id ):
364+ """Test topic message submit tx should return array of one size for single-chunk transaction."""
365+ message = "small_content"
366+ tx = (
367+ TopicMessageSubmitTransaction ()
368+ .set_topic_id (topic_id )
369+ .set_message (message )
370+ .set_transaction_id (transaction_id )
371+ .set_node_account_id (account_id )
372+ .freeze ()
373+ )
374+
375+ sizes = tx .body_size_all_chunks
376+ assert isinstance (sizes , list )
377+ assert len (sizes ) == 1
378+
379+
341380def test_tx_with_no_content_should_return_single_body_chunk (
342381 file_id , account_id , transaction_id
343382):
0 commit comments