(node_factory)
| 460 | @pytest.mark.openchannel('v1') |
| 461 | @pytest.mark.openchannel('v2') |
| 462 | def test_disconnect(node_factory): |
| 463 | # These should all make us fail |
| 464 | disconnects = ['-WIRE_INIT', |
| 465 | '+WIRE_INIT'] |
| 466 | l1 = node_factory.get_node(disconnect=disconnects) |
| 467 | l2 = node_factory.get_node() |
| 468 | |
| 469 | with pytest.raises(RpcError): |
| 470 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 471 | with pytest.raises(RpcError): |
| 472 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 473 | |
| 474 | # Should have 3 connect fails. |
| 475 | for d in disconnects: |
| 476 | l1.daemon.wait_for_log('{}-.*Failed connected out' |
| 477 | .format(l2.info['id'])) |
| 478 | |
| 479 | # Should still only have one peer! |
| 480 | assert len(l1.rpc.listpeers()) == 1 |
| 481 | assert len(l2.rpc.listpeers()) == 1 |
| 482 | |
| 483 | |
| 484 | @pytest.mark.openchannel('v1') |
nothing calls this directly
no test coverage detected