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

Function test_search_partial_match

tests/test_reckless.py:227–250  ·  view source on GitHub ↗

test that partial/substring search returns multiple matches

(node_factory)

Source from the content-addressed store, hash-verified

225
226
227def test_search_partial_match(node_factory):
228 """test that partial/substring search returns multiple matches"""
229 n = get_reckless_node(node_factory)
230
231 # Search for partial name "testplug" - should find all test plugins
232 r = reckless([f"--network={NETWORK}", "search", "testplug"], dir=n.lightning_dir)
233 # Should show the "Plugins matching" header
234 assert r.search_stdout("Plugins matching 'testplug':")
235 # Should list multiple plugins (all start with "testplug")
236 assert r.search_stdout('testplugpass')
237 assert r.search_stdout('testplugfail')
238 assert r.search_stdout('testplugpyproj')
239 assert r.search_stdout('testpluguv')
240
241 # Search for "pass" - should find testplugpass
242 r = reckless([f"--network={NETWORK}", "search", "pass"], dir=n.lightning_dir)
243 assert r.search_stdout("Plugins matching 'pass':")
244 assert r.search_stdout('testplugpass')
245 # Should not find plugins without "pass" in name
246 assert not r.search_stdout('testplugfail')
247
248 # Search for something that doesn't exist
249 r = reckless([f"--network={NETWORK}", "search", "nonexistent"], dir=n.lightning_dir)
250 assert r.search_stdout("Search exhausted all sources")
251
252
253def test_install(node_factory):

Callers

nothing calls this directly

Calls 3

get_reckless_nodeFunction · 0.85
search_stdoutMethod · 0.80
recklessFunction · 0.70

Tested by

no test coverage detected