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

Function test_disable_enable

tests/test_reckless.py:312–339  ·  view source on GitHub ↗

test search, git clone, and installation to folder.

(node_factory)

Source from the content-addressed store, hash-verified

310
311@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")
312def test_disable_enable(node_factory):
313 """test search, git clone, and installation to folder."""
314 n = get_reckless_node(node_factory)
315 # Test case-insensitive search as well
316 r = reckless([f"--network={NETWORK}", "-v", "install", "testPlugPass"],
317 dir=n.lightning_dir)
318 assert r.returncode == 0
319 assert r.search_stdout('dependencies installed successfully')
320 assert r.search_stdout('plugin installed:')
321 assert r.search_stdout('testplugpass enabled')
322 r.check_stderr()
323 plugin_path = Path(n.lightning_dir) / 'reckless/testplugpass'
324 print(plugin_path)
325 assert os.path.exists(plugin_path)
326 r = reckless([f"--network={NETWORK}", "-v", "disable", "testPlugPass"],
327 dir=n.lightning_dir)
328 assert r.returncode == 0
329 n.start()
330 # Should find it with or without the file extension
331 r = reckless([f"--network={NETWORK}", "-v", "enable", "testplugpass.py"],
332 dir=n.lightning_dir)
333 assert r.returncode == 0
334 assert r.search_stdout('testplugpass enabled')
335 test_plugin = {'name': str(plugin_path / 'testplugpass.py'),
336 'active': True, 'dynamic': True}
337 time.sleep(1)
338 print(n.rpc.plugin_list()['plugins'])
339 assert test_plugin in n.rpc.plugin_list()['plugins']
340
341
342@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected