22
33from hiero_sdk_python .account .account_create_transaction import AccountCreateTransaction
44from hiero_sdk_python .account .account_id import AccountId
5+ from hiero_sdk_python .consensus .topic_id import TopicId
6+ from hiero_sdk_python .consensus .topic_message_submit_transaction import TopicMessageSubmitTransaction
57from hiero_sdk_python .crypto .private_key import PrivateKey
68from hiero_sdk_python .exceptions import ReceiptStatusError
79from hiero_sdk_python .file .file_append_transaction import FileAppendTransaction
2729
2830@pytest .fixture
2931def file_id ():
30- """Returns a file_is for test."""
32+ """Returns a file_id for test."""
3133 return FileId .from_string ("0.0.1" )
3234
3335
@@ -277,8 +279,8 @@ def test_tx_without_optional_fields_should_have_smaller_tx_body(
277279 assert tx1 .body_size < tx2 .body_size
278280
279281
280- def test_chunk_tx_should_return_list_of_body_sizes (file_id , account_id , transaction_id ):
281- """Test should return array of body sizes for multi-chunk transaction."""
282+ def test_file_append_chunk_tx_should_return_list_of_body_sizes (file_id , account_id , transaction_id ):
283+ """Test file append tx should return array of body sizes for multi-chunk transaction."""
282284 chunk_size = 1024
283285 content = "a" * (chunk_size * 3 )
284286
@@ -297,8 +299,8 @@ def test_chunk_tx_should_return_list_of_body_sizes(file_id, account_id, transact
297299 assert len (sizes ) == 3
298300
299301
300- def test_single_chunk_tx_return_list_of_len_one (file_id , account_id , transaction_id ):
301- """Test should return array of one size for single-chunk transaction."""
302+ def test_file_append_single_chunk_tx_return_list_of_len_one (file_id , account_id , transaction_id ):
303+ """Test file append tx should return array of one size for single-chunk transaction."""
302304 content = "small_content"
303305 tx = (
304306 FileAppendTransaction ()
@@ -314,6 +316,43 @@ def test_single_chunk_tx_return_list_of_len_one(file_id, account_id, transaction
314316 assert len (sizes ) == 1
315317
316318
319+ def test_message_submit_chunk_tx_should_return_list_of_body_sizes (topic_id , account_id , transaction_id ):
320+ """Test topic message submit tx should return array of body sizes for multi-chunk transaction."""
321+ chunk_size = 1024
322+ message = "a" * (chunk_size * 3 )
323+
324+ tx = (
325+ TopicMessageSubmitTransaction ()
326+ .set_topic_id (topic_id )
327+ .set_chunk_size (chunk_size )
328+ .set_message (message )
329+ .set_transaction_id (transaction_id )
330+ .set_node_account_id (account_id )
331+ .freeze ()
332+ )
333+
334+ sizes = tx .body_size_all_chunks
335+ assert isinstance (sizes , list )
336+ assert len (sizes ) == 3
337+
338+
339+ def test_message_submit_single_chunk_tx_return_list_of_len_one (topic_id , account_id , transaction_id ):
340+ """Test topic message submit tx should return array of one size for single-chunk transaction."""
341+ message = "small_content"
342+ tx = (
343+ TopicMessageSubmitTransaction ()
344+ .set_topic_id (topic_id )
345+ .set_message (message )
346+ .set_transaction_id (transaction_id )
347+ .set_node_account_id (account_id )
348+ .freeze ()
349+ )
350+
351+ sizes = tx .body_size_all_chunks
352+ assert isinstance (sizes , list )
353+ assert len (sizes ) == 1
354+
355+
317356def test_tx_with_no_content_should_return_single_body_chunk (
318357 file_id , account_id , transaction_id
319358):
0 commit comments