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
def test_positional_inject():
p = Plugin()
rdict = {
'id': 1,
'jsonrpc':
'2.0',
'method': 'func',
'params': {'a': 1, 'b': 2, 'kwa': 3, 'kwb': 4}
}
rarr = {
'id': 1,
'jsonrpc': '2.0',
'method': 'func',
'params': [1, 2, 3, 4]
}
rdict = Request(
plugin=p,
req_id=1,
method='func',
params={'a': 1, 'b': 2, 'kwa': 3, 'kwb': 4}
)
rarr = Request(
plugin=p,
req_id=1,
method='func',
params=[1, 2, 3, 4],
)
def pre_args(plugin, a, b, kwa=3, kwb=4):
assert (plugin, a, b, kwa, kwb) == (p, 1, 2, 3, 4)

Loading…
Cancel
Save