Browse Source

pytest: Configure non-legacy tests correctly and filter legacy

ppa-0.6.1
Christian Decker 8 years ago
committed by Rusty Russell
parent
commit
943b6526c7
  1. 2
      tests/test_lightningd.py
  2. 4
      tests/utils.py

2
tests/test_lightningd.py

@ -103,8 +103,6 @@ class NodeFactory(object):
with open(os.path.join(lightning_dir, "dev_disconnect"), "w") as f: with open(os.path.join(lightning_dir, "dev_disconnect"), "w") as f:
f.write("\n".join(disconnect)) f.write("\n".join(disconnect))
daemon.cmd_line.append("--dev-disconnect=dev_disconnect") daemon.cmd_line.append("--dev-disconnect=dev_disconnect")
# TODO(cdecker) Move into LIGHTNINGD_CONFIG once legacy daemon was removed
daemon.cmd_line.append("--dev-broadcast-interval=1000")
rpc = LightningRpc(socket_path, self.executor) rpc = LightningRpc(socket_path, self.executor)
node = utils.LightningNode(daemon, rpc, bitcoind, self.executor) node = utils.LightningNode(daemon, rpc, bitcoind, self.executor)

4
tests/utils.py

@ -214,6 +214,8 @@ class LightningD(TailableProc):
'--lightning-dir={}'.format(lightning_dir), '--lightning-dir={}'.format(lightning_dir),
'--port={}'.format(port), '--port={}'.format(port),
'--disable-irc', '--disable-irc',
'--network=regtest',
'--dev-broadcast-interval=1000',
] ]
self.cmd_line += ["--{}={}".format(k, v) for k, v in LIGHTNINGD_CONFIG.items()] self.cmd_line += ["--{}={}".format(k, v) for k, v in LIGHTNINGD_CONFIG.items()]
@ -235,6 +237,8 @@ class LegacyLightningD(LightningD):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
LightningD.__init__(self, *args, **kwargs) LightningD.__init__(self, *args, **kwargs)
self.cmd_line[0] = 'daemon/lightningd' self.cmd_line[0] = 'daemon/lightningd'
# Filter out non-legacy options
self.cmd_line = [c for c in self.cmd_line if '--network' not in c and '--dev-broadcast-interval' not in c]
def start(self): def start(self):
TailableProc.start(self) TailableProc.start(self)

Loading…
Cancel
Save