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

Function test_invalid_currency

tests/test_currencyrate.py:96–112  ·  view source on GitHub ↗
(node_factory, fake_rateserver)

Source from the content-addressed store, hash-verified

94
95
96def test_invalid_currency(node_factory, fake_rateserver):
97 opts = {
98 "currencyrate-disable-source": ALL_RESOURCES,
99 "currencyrate-add-source": [
100 f"invalid,{fake_rateserver['url']}/invalid?currency={{currency_lc}},price"
101 ],
102 }
103 l1 = node_factory.get_node(options=opts)
104
105 with pytest.raises(
106 RpcError,
107 match=r"no results for `XXX`, is the currency supported\? Check the logs!",
108 ):
109 rates = l1.rpc.call("listcurrencyrates", ["XXX"])
110 LOGGER.info(rates)
111
112 l1.daemon.wait_for_log("failed to get `XXX` rate from invalid")
113
114
115class _ServerThread(threading.Thread):

Callers

nothing calls this directly

Calls 3

wait_for_logMethod · 0.80
get_nodeMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected