From 66a28269763dd0261cf17cfd76742dddb0d905e3 Mon Sep 17 00:00:00 2001 From: niftynei Date: Thu, 18 Mar 2021 16:22:03 -0500 Subject: [PATCH] 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) --- tests/test_opening.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_opening.py b/tests/test_opening.py index 97e7f8777..610fb46d5 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -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):