From ac5002a79effd7c0468159698c59354849b9a275 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 4 Dec 2018 12:34:55 +1030 Subject: [PATCH] pytest: add hack to force options into a given order. Needed for testing plugin options which are order-senditive. Signed-off-by: Rusty Russell --- tests/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index 440f631d6..cab3bcc4d 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,5 +1,6 @@ from bitcoin.rpc import RawProxy as BitcoinProxy from btcproxy import BitcoinRpcProxy +from collections import OrderedDict from decimal import Decimal from ephemeral_port_reserve import reserve from lightning import LightningRpc @@ -23,14 +24,14 @@ BITCOIND_CONFIG = { } -LIGHTNINGD_CONFIG = { +LIGHTNINGD_CONFIG = OrderedDict({ "log-level": "debug", "cltv-delta": 6, "cltv-final": 5, "watchtime-blocks": 5, "rescan": 1, 'disable-dns': None, -} +}) with open('config.vars') as configfile: config = dict([(line.rstrip().split('=', 1)) for line in configfile]) @@ -344,7 +345,7 @@ class LightningD(TailableProc): def cmd_line(self): opts = [] - for k, v in sorted(self.opts.items()): + for k, v in self.opts.items(): if v is None: opts.append("--{}".format(k)) elif isinstance(v, list):