Skip to content

Commit c68471e

Browse files
Export NodeInfo from dqlitewire.messages for API completeness
NodeInfo is returned by ServersResponse.nodes but was not importable from dqlitewire.messages, forcing users to reach into the private dqlitewire.messages.responses module path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6e41d60 commit c68471e

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/dqlitewire/messages/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
FilesResponse,
3131
LeaderResponse,
3232
MetadataResponse,
33+
NodeInfo,
3334
ResultResponse,
3435
RowsResponse,
3536
ServersResponse,
@@ -74,4 +75,5 @@
7475
"FilesResponse",
7576
"ServersResponse",
7677
"MetadataResponse",
78+
"NodeInfo",
7779
]

tests/test_constants.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,17 @@ def test_connect_is_11(self) -> None:
117117
should include it.
118118
"""
119119
assert RequestType.CONNECT == 11
120+
121+
122+
class TestPublicExports:
123+
"""Verify important types are importable from public API paths."""
124+
125+
def test_nodeinfo_importable_from_messages(self) -> None:
126+
"""NodeInfo should be importable from dqlitewire.messages."""
127+
from dqlitewire.messages import NodeInfo
128+
129+
assert NodeInfo is not None
130+
# Verify it's the same class used by ServersResponse
131+
from dqlitewire.messages.responses import NodeInfo as DirectNodeInfo
132+
133+
assert NodeInfo is DirectNodeInfo

0 commit comments

Comments
 (0)