mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 08:04:26 +01:00
pytest: add hack to force options into a given order.
Needed for testing plugin options which are order-senditive. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
a4287f99fd
commit
ac5002a79e
@@ -1,5 +1,6 @@
|
|||||||
from bitcoin.rpc import RawProxy as BitcoinProxy
|
from bitcoin.rpc import RawProxy as BitcoinProxy
|
||||||
from btcproxy import BitcoinRpcProxy
|
from btcproxy import BitcoinRpcProxy
|
||||||
|
from collections import OrderedDict
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from ephemeral_port_reserve import reserve
|
from ephemeral_port_reserve import reserve
|
||||||
from lightning import LightningRpc
|
from lightning import LightningRpc
|
||||||
@@ -23,14 +24,14 @@ BITCOIND_CONFIG = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LIGHTNINGD_CONFIG = {
|
LIGHTNINGD_CONFIG = OrderedDict({
|
||||||
"log-level": "debug",
|
"log-level": "debug",
|
||||||
"cltv-delta": 6,
|
"cltv-delta": 6,
|
||||||
"cltv-final": 5,
|
"cltv-final": 5,
|
||||||
"watchtime-blocks": 5,
|
"watchtime-blocks": 5,
|
||||||
"rescan": 1,
|
"rescan": 1,
|
||||||
'disable-dns': None,
|
'disable-dns': None,
|
||||||
}
|
})
|
||||||
|
|
||||||
with open('config.vars') as configfile:
|
with open('config.vars') as configfile:
|
||||||
config = dict([(line.rstrip().split('=', 1)) for line in configfile])
|
config = dict([(line.rstrip().split('=', 1)) for line in configfile])
|
||||||
@@ -344,7 +345,7 @@ class LightningD(TailableProc):
|
|||||||
def cmd_line(self):
|
def cmd_line(self):
|
||||||
|
|
||||||
opts = []
|
opts = []
|
||||||
for k, v in sorted(self.opts.items()):
|
for k, v in self.opts.items():
|
||||||
if v is None:
|
if v is None:
|
||||||
opts.append("--{}".format(k))
|
opts.append("--{}".format(k))
|
||||||
elif isinstance(v, list):
|
elif isinstance(v, list):
|
||||||
|
|||||||
Reference in New Issue
Block a user