mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-23 16:14:20 +01:00
summary: Improve on the dummy test
This commit is contained in:
@@ -1,8 +1,45 @@
|
|||||||
from pyln.testing.fixtures import *
|
from pyln.testing.fixtures import *
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
pluginopt = {'plugin': os.path.join(os.path.dirname(__file__), "summary.py")}
|
pluginopt = {'plugin': os.path.join(os.path.dirname(__file__), "summary.py")}
|
||||||
|
|
||||||
|
|
||||||
def test_summary_start(node_factory):
|
def test_summary_start(node_factory):
|
||||||
l1 = node_factory.get_node(options=pluginopt)
|
l1 = node_factory.get_node(options=pluginopt)
|
||||||
l1.rpc.getinfo()
|
s = l1.rpc.summary()
|
||||||
|
from pprint import pprint;pprint(s)
|
||||||
|
|
||||||
|
expected = {
|
||||||
|
'format-hint': 'simple',
|
||||||
|
'network': 'REGTEST',
|
||||||
|
'num_channels': 0,
|
||||||
|
'num_connected': 0,
|
||||||
|
'num_gossipers': 0,
|
||||||
|
'num_utxos': 0,
|
||||||
|
'warning_no_address': 'NO PUBLIC ADDRESSES'
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v in expected.items():
|
||||||
|
assert(s[k] == v)
|
||||||
|
|
||||||
|
|
||||||
|
def test_summary_opts(directory):
|
||||||
|
opts = ['--summary-currency', '--summary-currency-prefix']
|
||||||
|
|
||||||
|
help_out = subprocess.check_output([
|
||||||
|
'lightningd',
|
||||||
|
'--lightning-dir={}'.format(directory),
|
||||||
|
'--help'
|
||||||
|
]).decode('utf-8')
|
||||||
|
for o in opts:
|
||||||
|
assert(o not in help_out)
|
||||||
|
|
||||||
|
help_out = subprocess.check_output([
|
||||||
|
'lightningd',
|
||||||
|
'--lightning-dir={}'.format(directory),
|
||||||
|
'--plugin={}'.format(pluginopt['plugin']),
|
||||||
|
'--help'
|
||||||
|
]).decode('utf-8')
|
||||||
|
for o in opts:
|
||||||
|
assert(o in help_out)
|
||||||
|
|||||||
Reference in New Issue
Block a user