pytest: Split test_disconnect

These were in part reusing some of the nodes, and creating new
instances for other, so I split them to avoid having cross pollution
between the tests.
This commit is contained in:
Christian Decker 2017-08-14 22:36:42 +02:00 committed by Rusty Russell
parent f085a474b2
commit 9ad8365589

View File

@ -523,8 +523,8 @@ class LightningDTests(BaseLightningDTests):
# Now we should connect normally.
l1.rpc.connect('localhost', l2.info['port'], l2.info['id'])
l1.daemon.stop()
def test_disconnect_funder(self):
# Now error on funder side duringchannel open.
disconnects = ['-WIRE_OPEN_CHANNEL',
'@WIRE_OPEN_CHANNEL',
@ -532,6 +532,7 @@ class LightningDTests(BaseLightningDTests):
'-WIRE_FUNDING_CREATED',
'@WIRE_FUNDING_CREATED']
l1 = self.node_factory.get_node(legacy=False, disconnect=disconnects)
l2 = self.node_factory.get_node(legacy=False)
addr = l1.rpc.newaddr()['address']
txid = l1.bitcoin.rpc.sendtoaddress(addr, 20000 / 10**6)
@ -543,9 +544,7 @@ class LightningDTests(BaseLightningDTests):
self.assertRaises(ValueError, l1.rpc.fundchannel, l2.info['id'], 20000)
assert l1.rpc.getpeer(l2.info['id']) == None
l1.daemon.stop()
l2.daemon.stop()
def test_disconnect_fundee(self):
# Now error on fundee side during channel open.
disconnects = ['-WIRE_ACCEPT_CHANNEL',
'@WIRE_ACCEPT_CHANNEL',
@ -563,9 +562,7 @@ class LightningDTests(BaseLightningDTests):
self.assertRaises(ValueError, l1.rpc.fundchannel, l2.info['id'], 20000)
assert l1.rpc.getpeer(l2.info['id']) == None
l1.daemon.stop()
l2.daemon.stop()
def test_disconnect_half_signed(self):
# Now, these are the corner cases. Fundee sends funding_signed,
# but funder doesn't receive it.
disconnects = ['@WIRE_FUNDING_SIGNED']