File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,17 +93,6 @@ def test_topic_info_query(topic_id):
9393 assert result .admin_key is not None
9494
9595
96- def test_topic_info_query_with_empty_topic_id ():
97- """Test that TopicInfoQuery validates topic_id before execution."""
98- with mock_hedera_servers ([[None ]]) as client :
99- query = TopicInfoQuery () # No topic ID set
100-
101- with pytest .raises (ValueError ) as exc_info :
102- query .execute (client )
103-
104- assert "Topic ID must be set" in str (exc_info .value )
105-
106-
10796def test_make_request_builds_expected_protobuf (topic_id ):
10897 """
10998 Covers TopicInfoQuery._make_request() using REAL protobuf classes.
@@ -157,3 +146,14 @@ def test_freeze_prevents_set_topic_id_if_available(topic_id):
157146 query .set_topic_id (topic_id )
158147
159148 assert "frozen" in str (exc_info .value ).lower ()
149+
150+
151+ def test_topic_id_not_set_when_none ():
152+ """Test that topicId not set in proto when it is None."""
153+ query = TopicInfoQuery ()
154+ query .set_topic_id (None )
155+
156+ proto = query ._make_request ()
157+
158+ assert proto is not None
159+ assert not proto .consensusGetTopicInfo .HasField ("topicID" )
You can’t perform that action at this time.
0 commit comments