Skip to content

Commit 698eb04

Browse files
m-schmoockendothermicdev
authored andcommitted
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: ElementsProject#5990
1 parent 9a77a99 commit 698eb04

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_misc.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2831,6 +2831,18 @@ def test_force_feerates(node_factory):
28312831
"max_acceptable": 150000}
28322832

28332833

2834+
def test_datastore_escapeing(node_factory):
2835+
""" This test demonstrates that there is some character escaping issue
2836+
issue in the datastore API and error messages during startup that
2837+
affect plugins init method. """
2838+
setdata = '{"foo": "bar"}'
2839+
l1 = node_factory.get_node()
2840+
l1.rpc.datastore(key='foo_bar', string=setdata)
2841+
getdata = l1.rpc.listdatastore('foo_bar')['datastore'][0]['string']
2842+
assert not l1.daemon.is_in_log(r".*listdatastore error.*token has no index 0.*")
2843+
assert getdata == setdata
2844+
2845+
28342846
def test_datastore(node_factory):
28352847
l1 = node_factory.get_node()
28362848

0 commit comments

Comments
 (0)