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

Function test_usage

contrib/pyln-client/tests/test_plugin.py:440–456  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

438
439
440def test_usage():
441 p = Plugin(autopatch=False)
442
443 @p.method("some_method")
444 def some_method(some_arg: str = None):
445 """some description"""
446 pass
447
448 manifest = p._getmanifest()
449 usage = p.get_usage()
450
451 assert manifest['rpcmethods'][0]['name'] == 'some_method'
452 assert "some_arg" in manifest['rpcmethods'][0]['usage']
453 assert "some description" in manifest['rpcmethods'][0]['usage']
454 assert "some_method" in usage
455 assert "some_arg" in usage
456 assert "some description" in usage
457
458
459def test_hook_fallbacks_and_exception_redaction():

Callers

nothing calls this directly

Calls 3

_getmanifestMethod · 0.95
get_usageMethod · 0.95
PluginClass · 0.90

Tested by

no test coverage detected