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

Function test_utf8_passthrough

tests/test_plugin.py:670–686  ·  view source on GitHub ↗
(node_factory, executor)

Source from the content-addressed store, hash-verified

668
669
670def test_utf8_passthrough(node_factory, executor):
671 l1 = node_factory.get_node(options={'plugin': os.path.join(os.getcwd(), 'tests/plugins/utf8.py'),
672 'log-level': 'io'})
673
674 # This works because Python unmangles.
675 res = l1.rpc.call('utf8', ['ナンセンス 1杯'])
676 assert '\\u' not in res['utf8']
677 assert res['utf8'] == 'ナンセンス 1杯'
678
679 # Now, try native.
680 out = subprocess.check_output(['cli/lightning-cli',
681 '--network={}'.format(TEST_NETWORK),
682 '--lightning-dir={}'
683 .format(l1.daemon.lightning_dir),
684 'utf8', 'ナンセンス 1杯']).decode('utf-8')
685 assert '\\u' not in out
686 assert out == '{\n "utf8": "ナンセンス 1杯"\n}\n'
687
688
689def test_invoice_payment_hook(node_factory):

Callers

nothing calls this directly

Calls 4

joinMethod · 0.80
get_nodeMethod · 0.45
callMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected