Skip to content

Commit a691f5b

Browse files
pytest: test reckless direct install
1 parent 3bf30d0 commit a691f5b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/test_reckless.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,8 @@ def test_local_dir_install(node_factory):
235235
"""Test search and install from local directory source."""
236236
n = get_reckless_node(node_factory)
237237
n.start()
238-
r = reckless([f"--network={NETWORK}", "-v", "source", "add",
239-
os.path.join(n.lightning_dir, '..', 'lightningd', 'testplugpass')],
240-
dir=n.lightning_dir)
238+
source_dir = str(Path(n.lightning_dir / '..' / 'lightningd' / 'testplugpass').resolve())
239+
r = reckless([f"--network={NETWORK}", "-v", "source", "add", source_dir], dir=n.lightning_dir)
241240
assert r.returncode == 0
242241
r = reckless([f"--network={NETWORK}", "-v", "install", "testplugpass"], dir=n.lightning_dir)
243242
assert r.returncode == 0
@@ -246,6 +245,15 @@ def test_local_dir_install(node_factory):
246245
print(plugin_path)
247246
assert os.path.exists(plugin_path)
248247

248+
# Retry with a direct install passing the full path to the local source
249+
r = reckless(['uninstall', 'testplugpass', '-v'], dir=n.lightning_dir)
250+
assert not os.path.exists(plugin_path)
251+
r = reckless(['source', 'remove', source_dir], dir=n.lightning_dir)
252+
assert 'plugin source removed' in r.stdout
253+
r = reckless(['install', '-v', source_dir], dir=n.lightning_dir)
254+
assert 'testplugpass enabled' in r.stdout
255+
assert os.path.exists(plugin_path)
256+
249257

250258
@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")
251259
def test_disable_enable(node_factory):

0 commit comments

Comments
 (0)