Skip to content

Commit f9a7208

Browse files
committed
chore: updated test for none id
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
1 parent 0e6bafa commit f9a7208

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

tests/unit/topic_info_query_test.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff 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-
10796
def 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")

0 commit comments

Comments
 (0)