Browse Source

fixup! pylightning: Wrap request in an object

Signed-off-by: Christian Decker <decker.christian@gmail.com>
pylightning-async
Christian Decker 6 years ago
parent
commit
1cb8610cae
No known key found for this signature in database GPG Key ID: 1416D83DC4F0E86D
  1. 27
      contrib/pylightning/lightning/test_plugin.py

27
contrib/pylightning/lightning/test_plugin.py

@ -1,22 +1,21 @@
from .plugin import Plugin from .plugin import Plugin, Request
import itertools import itertools
def test_positional_inject(): def test_positional_inject():
p = Plugin() p = Plugin()
rdict = { rdict = Request(
'id': 1, plugin=p,
'jsonrpc': req_id=1,
'2.0', method='func',
'method': 'func', params={'a': 1, 'b': 2, 'kwa': 3, 'kwb': 4}
'params': {'a': 1, 'b': 2, 'kwa': 3, 'kwb': 4} )
} rarr = Request(
rarr = { plugin=p,
'id': 1, req_id=1,
'jsonrpc': '2.0', method='func',
'method': 'func', params=[1, 2, 3, 4],
'params': [1, 2, 3, 4] )
}
def pre_args(plugin, a, b, kwa=3, kwb=4): def pre_args(plugin, a, b, kwa=3, kwb=4):
assert (plugin, a, b, kwa, kwb) == (p, 1, 2, 3, 4) assert (plugin, a, b, kwa, kwb) == (p, 1, 2, 3, 4)

Loading…
Cancel
Save