Skip to content

Commit 0e94d05

Browse files
committed
Adds tests
1 parent b72b7e7 commit 0e94d05

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/integration_tests/test_async_substrate_interface.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,16 @@ async def test_reconnection():
161161
bh = await substrate.get_chain_finalised_head()
162162
assert isinstance(bh, str)
163163
assert isinstance(await substrate.get_block_number(bh), int)
164+
165+
166+
@pytest.mark.asyncio
167+
async def test_query_map_with_odd_number_of_params():
168+
async with AsyncSubstrateInterface(ARCHIVE_ENTRYPOINT, ss58_format=42) as substrate:
169+
qm = await substrate.query_map(
170+
"SubtensorModule",
171+
"Alpha",
172+
["5CoZxgtfhcJKX2HmkwnsN18KbaT9aih9eF3b6qVPTgAUbifj"],
173+
)
174+
first_record = qm.records[0]
175+
assert len(first_record) == 2
176+
assert len(first_record[0]) == 4

tests/integration_tests/test_substrate_interface.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,15 @@ def test_query_multiple():
100100
storage_function="OwnedHotkeys",
101101
block_hash=block_hash,
102102
)
103+
104+
105+
def test_query_map_with_odd_number_of_params():
106+
with SubstrateInterface(LATENT_LITE_ENTRYPOINT, ss58_format=42) as substrate:
107+
qm = substrate.query_map(
108+
"SubtensorModule",
109+
"Alpha",
110+
["5CoZxgtfhcJKX2HmkwnsN18KbaT9aih9eF3b6qVPTgAUbifj"],
111+
)
112+
first_record = qm.records[0]
113+
assert len(first_record) == 2
114+
assert len(first_record[0]) == 4

0 commit comments

Comments
 (0)