Skip to content

Commit

Permalink
test: Fixed test plugin source paths for reckless
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahanaFarooqui authored and rustyrussell committed Nov 18, 2024
1 parent 047eb8b commit 2e52df4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/test_reckless.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,26 +166,27 @@ def test_sources(node_factory):
assert (reckless_dir / '.sources').exists()
print(os.listdir(reckless_dir))
print(reckless_dir / '.sources')
plugin_dir = str(os.path.join(n.lightning_dir, '..', 'lightningd'))
r = reckless([f"--network={NETWORK}", "-v", "source", "add",
"tests/data/recklessrepo/lightningd/testplugfail"],
f'{plugin_dir}/testplugfail'],
dir=n.lightning_dir)
r = reckless([f"--network={NETWORK}", "-v", "source", "add",
"tests/data/recklessrepo/lightningd/testplugpass"],
f'{plugin_dir}/testplugpass'],
dir=n.lightning_dir)
with open(reckless_dir / '.sources') as sources:
contents = [c.strip() for c in sources.readlines()]
print('contents:', contents)
assert 'https://github.com/lightningd/plugins' in contents
assert "tests/data/recklessrepo/lightningd/testplugfail" in contents
assert "tests/data/recklessrepo/lightningd/testplugpass" in contents
assert f'{plugin_dir}/testplugfail' in contents
assert f'{plugin_dir}/testplugpass' in contents
r = reckless([f"--network={NETWORK}", "-v", "source", "remove",
"tests/data/recklessrepo/lightningd/testplugfail"],
f'{plugin_dir}/testplugfail'],
dir=n.lightning_dir)
with open(reckless_dir / '.sources') as sources:
contents = [c.strip() for c in sources.readlines()]
print('contents:', contents)
assert "tests/data/recklessrepo/lightningd/testplugfail" not in contents
assert "tests/data/recklessrepo/lightningd/testplugpass" in contents
assert f'{plugin_dir}/testplugfail' not in contents
assert f'{plugin_dir}/testplugpass' in contents


def test_search(node_factory):
Expand Down Expand Up @@ -236,7 +237,7 @@ def test_local_dir_install(node_factory):
n = get_reckless_node(node_factory)
n.start()
r = reckless([f"--network={NETWORK}", "-v", "source", "add",
"tests/data/recklessrepo/lightningd/testplugpass"],
os.path.join(n.lightning_dir, '..', 'lightningd', 'testplugpass')],
dir=n.lightning_dir)
assert r.returncode == 0
r = reckless([f"--network={NETWORK}", "-v", "install", "testplugpass"], dir=n.lightning_dir)
Expand Down

0 comments on commit 2e52df4

Please sign in to comment.