Skip to content

Commit

Permalink
pytest: Adjust custommsg test to check the new payload
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker committed Mar 1, 2021
1 parent 80287a5 commit 8c5553d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tests/plugins/custommsg_a.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@


@plugin.hook('custommsg')
def on_custommsg(peer_id, message, plugin, **kwargs):
def on_custommsg(peer_id, payload, plugin, message=None, **kwargs):
plugin.log("Got custommessage_a {msg} from peer {peer_id}".format(
msg=message,
msg=payload,
peer_id=peer_id
))
return {'result': 'continue'}
Expand Down
4 changes: 2 additions & 2 deletions tests/plugins/custommsg_b.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@


@plugin.hook('custommsg')
def on_custommsg(peer_id, message, plugin, **kwargs):
def on_custommsg(peer_id, payload, plugin, message=None, **kwargs):
plugin.log("Got custommessage_b {msg} from peer {peer_id}".format(
msg=message,
msg=payload,
peer_id=peer_id
))
return {'result': 'continue'}
Expand Down
16 changes: 8 additions & 8 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2283,10 +2283,10 @@ def test_sendcustommsg(node_factory):
)
l1.daemon.wait_for_log(r'\[IN\] {}'.format(serialized))
l1.daemon.wait_for_logs([
r'Got custommessage_a {serialized} from peer {peer_id}'.format(
serialized=serialized, peer_id=l2.info['id']),
r'Got custommessage_b {serialized} from peer {peer_id}'.format(
serialized=serialized, peer_id=l2.info['id'])
r'Got custommessage_a {msg} from peer {peer_id}'.format(
msg=msg, peer_id=l2.info['id']),
r'Got custommessage_b {msg} from peer {peer_id}'.format(
msg=msg, peer_id=l2.info['id'])
])

# This should work since the peer is currently owned by `openingd`
Expand All @@ -2298,10 +2298,10 @@ def test_sendcustommsg(node_factory):
)
l4.daemon.wait_for_log(r'\[IN\] {}'.format(serialized))
l4.daemon.wait_for_logs([
r'Got custommessage_a {serialized} from peer {peer_id}'.format(
serialized=serialized, peer_id=l2.info['id']),
r'Got custommessage_b {serialized} from peer {peer_id}'.format(
serialized=serialized, peer_id=l2.info['id']),
r'Got custommessage_a {msg} from peer {peer_id}'.format(
msg=msg, peer_id=l2.info['id']),
r'Got custommessage_b {msg} from peer {peer_id}'.format(
msg=msg, peer_id=l2.info['id']),
])


Expand Down

0 comments on commit 8c5553d

Please sign in to comment.