Skip to content

Commit

Permalink
pytest: adds xfail test that shows datastore issues
Browse files Browse the repository at this point in the history
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
  • Loading branch information
m-schmoock authored and endothermicdev committed Feb 11, 2023
1 parent 9a77a99 commit 698eb04
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2831,6 +2831,18 @@ def test_force_feerates(node_factory):
"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):
l1 = node_factory.get_node()

Expand Down

0 comments on commit 698eb04

Please sign in to comment.