pytest: adds xfail test that shows datastore issues

When doing some plugin related work, I discovered that the datastore API
has two issues:

- Error messages on startup of plugins init method when the datastore is
  still completely empty: "Parsing '{datastore:[0:': token has no index 0: []"
- Data is escaped but not unwrapped again when sending and getting from
  the API.

[ Removed xfail, it now passes! --RR ]
Closes: #5990
This commit is contained in:
Michael Schmoock
2023-02-11 12:03:56 +10:30
committed by Alex Myers
parent 9a77a995a8
commit 698eb0408f

View File

@@ -2831,6 +2831,18 @@ def test_force_feerates(node_factory):
"max_acceptable": 150000} "max_acceptable": 150000}
def test_datastore_escapeing(node_factory):
""" This test demonstrates that there is some character escaping issue
issue in the datastore API and error messages during startup that
affect plugins init method. """
setdata = '{"foo": "bar"}'
l1 = node_factory.get_node()
l1.rpc.datastore(key='foo_bar', string=setdata)
getdata = l1.rpc.listdatastore('foo_bar')['datastore'][0]['string']
assert not l1.daemon.is_in_log(r".*listdatastore error.*token has no index 0.*")
assert getdata == setdata
def test_datastore(node_factory): def test_datastore(node_factory):
l1 = node_factory.get_node() l1 = node_factory.get_node()