Skip to content

Commit bc2e33e

Browse files
tests: add the paginator test suite
Signed-off-by: Vincenzo Palazzo <[email protected]>
1 parent 7eebbbb commit bc2e33e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/test_paginator.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""
2+
I think I'm getting to excited for this paginator API
3+
that I think this deserve a own python test file!
4+
"""
5+
from fixtures import * # noqua: F401,F403
6+
7+
8+
def test_listnodes_paginator(node_factory):
9+
"""
10+
We run 4 nodes and then we query the
11+
list node by batch for the other two nodes.
12+
"""
13+
l1, l2, l3, _ = node_factory.line_graph(4, fundchannel=True, wait_for_announce=True)
14+
l1.rpc.jsonschemas = {}
15+
16+
nodes = l1.rpc.call("listnodes", { "batch": [l3.info["id"], l2.info["id"]] })
17+
nodes_nobatch = l1.rpc.listnodes()
18+
print(nodes)
19+
print(nodes_nobatch)
20+
assert len(nodes["nodes"]) == 2
21+
assert len(nodes_nobatch["nodes"]) == 4

0 commit comments

Comments
 (0)