MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_local_dir_install

Function test_local_dir_install

tests/test_reckless.py:287–308  ·  view source on GitHub ↗

Test search and install from local directory source.

(node_factory)

Source from the content-addressed store, hash-verified

285
286@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")
287def test_local_dir_install(node_factory):
288 """Test search and install from local directory source."""
289 n = get_reckless_node(node_factory)
290 n.start()
291 source_dir = str(Path(n.lightning_dir / '..' / 'lightningd' / 'testplugpass').resolve())
292 r = reckless([f"--network={NETWORK}", "-v", "source", "add", source_dir], dir=n.lightning_dir)
293 assert r.returncode == 0
294 r = reckless([f"--network={NETWORK}", "-v", "install", "testplugpass"], dir=n.lightning_dir)
295 assert r.returncode == 0
296 assert r.search_stdout('testplugpass enabled')
297 plugin_path = Path(n.lightning_dir) / 'reckless/testplugpass'
298 print(plugin_path)
299 assert os.path.exists(plugin_path)
300
301 # Retry with a direct install passing the full path to the local source
302 r = reckless(['uninstall', 'testplugpass', '-v'], dir=n.lightning_dir)
303 assert not os.path.exists(plugin_path)
304 r = reckless(['source', 'remove', source_dir], dir=n.lightning_dir)
305 assert r.search_stdout('plugin source removed')
306 r = reckless(['install', '-v', source_dir], dir=n.lightning_dir)
307 assert r.search_stdout('testplugpass enabled')
308 assert os.path.exists(plugin_path)
309
310
311@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")

Callers

nothing calls this directly

Calls 4

get_reckless_nodeFunction · 0.85
search_stdoutMethod · 0.80
recklessFunction · 0.70
startMethod · 0.45

Tested by

no test coverage detected