Browse Source

unit tests: split test_payment_trampoline into two tests

master
ThomasV 3 years ago
parent
commit
26245c1ac9
  1. 12
      electrum/tests/test_lnpeer.py

12
electrum/tests/test_lnpeer.py

@ -1081,8 +1081,7 @@ class TestPeer(TestCaseForTestnet):
graph = self.prepare_chans_and_peers_in_graph(GRAPH_DEFINITIONS['square_graph'])
self._run_mpp(graph, {'mpp_invoice': False}, {'mpp_invoice': True})
@needs_test_with_all_chacha20_implementations
def test_payment_trampoline(self):
def _run_trampoline_payment(self, is_legacy):
async def turn_on_trampoline_alice():
if graph.workers['alice'].network.channel_db:
graph.workers['alice'].network.channel_db.stop()
@ -1106,7 +1105,6 @@ class TestPeer(TestCaseForTestnet):
lnaddr, pay_req = self.prepare_invoice(graph.workers['dave'], include_routing_hints=True)
await group.spawn(pay(lnaddr, pay_req))
for is_legacy in (True, False):
graph_definition = GRAPH_DEFINITIONS['square_graph'].copy()
# insert a channel from bob to carol for faster tests,
# otherwise will fail randomly
@ -1126,6 +1124,14 @@ class TestPeer(TestCaseForTestnet):
with self.assertRaises(PaymentDone):
run(f())
@needs_test_with_all_chacha20_implementations
def test_trampoline_payment_legacy(self):
self._run_trampoline_payment(True)
@needs_test_with_all_chacha20_implementations
def test_trampoline_payment_e2e(self):
self._run_trampoline_payment(False)
@needs_test_with_all_chacha20_implementations
def test_payment_multipart_trampoline_e2e(self):
graph = self.prepare_chans_and_peers_in_graph(GRAPH_DEFINITIONS['square_graph'])

Loading…
Cancel
Save