mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-25 00:44:20 +01:00
The old skipIf annotation doesn't seem to work correctly: ``` PytestUnknownMarkWarning: Unknown pytest.mark.skipIf - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html @pytest.mark.skipIf(True, "Test autopilot is hanging on DNS request") ```
29 lines
872 B
Python
29 lines
872 B
Python
import os
|
|
from pyln.testing.fixtures import * # noqa: F401,F403
|
|
import unittest
|
|
|
|
CI = os.environ.get('CI') in ('True', 'true')
|
|
|
|
plugin_path = os.path.join(os.path.dirname(__file__), "autopilot.py")
|
|
plugin_opt = {'plugin': plugin_path}
|
|
|
|
|
|
def test_starts(node_factory):
|
|
l1 = node_factory.get_node()
|
|
# Test dynamically
|
|
l1.rpc.plugin_start(plugin_path)
|
|
l1.rpc.plugin_stop(plugin_path)
|
|
l1.rpc.plugin_start(plugin_path)
|
|
l1.stop()
|
|
# Then statically
|
|
l1.daemon.opts["plugin"] = plugin_path
|
|
l1.start()
|
|
|
|
|
|
@unittest.skipIf(CI, "Test autopilot is hanging on DNS request")
|
|
def test_main(node_factory):
|
|
l1, l2 = node_factory.line_graph(2, wait_for_announce=True, opts=plugin_opt)
|
|
# just call main function
|
|
l1.rpc.autopilot_run_once(dryrun=True)
|
|
l1.daemon.wait_for_log("I'd like to open [0-9]* new channels with [0-9]* satoshis each")
|