Skip to content

Commit

Permalink
watchtower-plugin: adapts tests to stop using deprecated options/comm…
Browse files Browse the repository at this point in the history
…ands
  • Loading branch information
sr-gi committed Mar 29, 2024
1 parent 2878362 commit f764947
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
16 changes: 1 addition & 15 deletions watchtower-plugin/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import subprocess

from pyln.testing.fixtures import * # noqa: F401,F403
from pyln.testing.utils import DEVELOPER, BITCOIND_CONFIG, TailableProc
from pyln.testing.utils import BITCOIND_CONFIG, TailableProc

WT_PLUGIN = Path("~/.cargo/bin/watchtower-client").expanduser()
TEOSD_CONFIG = {
Expand Down Expand Up @@ -115,20 +115,6 @@ def pytest_runtest_makereport(item, call):

setattr(item, "rep_" + rep.when, rep)


def pytest_configure(config):
config.addinivalue_line("markers", "developer: only run when developer is flagged on")


def pytest_runtest_setup(item):
for mark in item.iter_markers(name="developer"):
if not DEVELOPER:
if len(mark.args):
pytest.skip("!DEVELOPER: {}".format(mark.args[0]))
else:
pytest.skip("!DEVELOPER: Requires DEVELOPER=1")


@pytest.fixture(scope="function", autouse=True)
def log_name(request):
# Here logging is used, you can use whatever you want to use for logs
Expand Down
4 changes: 1 addition & 3 deletions watchtower-plugin/tests/test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
from pyln.client import RpcError
from conftest import WT_PLUGIN


Expand All @@ -16,7 +15,6 @@ def change_endianness(x):
return b[::-1].hex()


@pytest.mark.developer("Requires dev_sign_last_tx")
def test_watchtower(node_factory, bitcoind, teosd):
"""
Test watchtower hook.
Expand Down Expand Up @@ -60,7 +58,7 @@ def test_watchtower(node_factory, bitcoind, teosd):
penalty_txid = bitcoind.rpc.getrawmempool()[0]

# The channel still exists between the two peers, but it's on chain
assert l1.rpc.listpeers()["peers"][0]["channels"][0]["state"] == "ONCHAIN"
assert l1.rpc.listpeerchannels()["channels"][0]["state"] == "ONCHAIN"
assert l2.rpc.getappointment(tower_id, locator)["status"] == "dispute_responded"

# Generate blocks until the penalty gets irrevocably resolved
Expand Down

0 comments on commit f764947

Please sign in to comment.