@@ -99,6 +99,11 @@ def test_constructor_and_setters(topic_id, message, custom_fee_limit):
9999 assert tx_default .custom_fee_limits [0 ] == custom_fee_limit
100100 assert result is tx_default
101101
102+ # Test clear_custom_fee_limits
103+ result = tx_default .clear_custom_fee_limits ()
104+ assert tx_default .custom_fee_limits == []
105+ assert result is tx_default
106+
102107
103108def test_set_methods_require_not_frozen (mock_client , topic_id , message , custom_fee_limit ):
104109 """Test that setter methods raise exception when transaction is frozen."""
@@ -122,6 +127,16 @@ def test_set_methods_require_not_frozen(mock_client, topic_id, message, custom_f
122127 getattr (tx , method_name )(value )
123128
124129
130+ def test_clear_custom_fee_limits_requires_not_frozen (mock_client , topic_id , message , custom_fee_limit ):
131+ """Test that clear_custom_fee_limits() raises when the transaction is frozen."""
132+ tx = TopicMessageSubmitTransaction (topic_id = topic_id , message = message )
133+ tx .add_custom_fee_limit (custom_fee_limit )
134+ tx .freeze_with (mock_client )
135+
136+ with pytest .raises (Exception , match = "Transaction is immutable; it has been frozen" ):
137+ tx .clear_custom_fee_limits ()
138+
139+
125140def test_method_chaining (topic_id , message , custom_fee_limit ):
126141 """Test method chaining functionality."""
127142 tx = TopicMessageSubmitTransaction ()
@@ -144,6 +159,10 @@ def test_method_chaining(topic_id, message, custom_fee_limit):
144159 assert tx .chunk_size == chunk_size
145160 assert tx .max_chunks == max_chunks
146161
162+ result = tx .clear_custom_fee_limits ()
163+ assert result is tx
164+ assert tx .custom_fee_limits == []
165+
147166
148167def test_get_method ():
149168 """Test retrieving the gRPC method for the transaction."""
0 commit comments