df-tests: make bad tests a bit better, maybe

We updated the "UNKNOWN TYPE channel_id" -> the actual channel id;
the reason for why the error fails shouldn't be restrictive (we just
know that it fails)
This commit is contained in:
niftynei 2021-03-18 16:22:03 -05:00 committed by Rusty Russell
parent de52abbcde
commit 66a2826976
1 changed files with 8 additions and 8 deletions

View File

@ -124,13 +124,13 @@ def test_v2_open_sigs_restart(node_factory, bitcoind):
# Fund the channel, should appear to finish ok even though the
# peer fails
with pytest.raises(RpcError, match=r'Peer not connected'):
with pytest.raises(RpcError):
l1.rpc.fundchannel(l2.info['id'], chan_amount)
log = l1.daemon.is_in_log('UNKNOWN TYPE channel_id psbt')
psbt = re.search("channel_id psbt (.*)", log).group(1)
chan_id = first_channel_id(l1, l2)
log = l1.daemon.is_in_log('{} psbt'.format(chan_id))
psbt = re.search("psbt (.*)", log).group(1)
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
l1.daemon.wait_for_log('Peer has reconnected, state DUALOPEND_OPEN_INIT')
with pytest.raises(RpcError):
@ -170,13 +170,13 @@ def test_v2_open_sigs_restart_while_dead(node_factory, bitcoind):
# Fund the channel, should appear to finish ok even though the
# peer fails
with pytest.raises(RpcError, match=r'Peer not connected'):
with pytest.raises(RpcError):
l1.rpc.fundchannel(l2.info['id'], chan_amount)
log = l1.daemon.is_in_log('UNKNOWN TYPE channel_id psbt')
psbt = re.search("channel_id psbt (.*)", log).group(1)
chan_id = first_channel_id(l1, l2)
log = l1.daemon.is_in_log('{} psbt'.format(chan_id))
psbt = re.search("psbt (.*)", log).group(1)
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
l1.daemon.wait_for_log('Peer has reconnected, state DUALOPEND_OPEN_INIT')
with pytest.raises(RpcError):