core-lightning/contrib/pyln-proto/tests/test_bolt7.py
Rusty Russell 85bb93618b new modules: pyln.proto.message.{bolt1,bolt2,bolt4,bolt7}
These are autogenerated, but now they export their own
MessageNamespace, as well as the raw csv.

They also expose their SubtypeTypes, MessageTypes and TlvStreamTypes,
though in theory these could clash (they don't for now, and it'd be
kinda awkward if they did).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-06-12 15:35:35 +02:00

15 lines
423 B
Python

#! /usr/bin/python3
from pyln.proto.message import MessageNamespace
import pyln.proto.message.bolt7 as bolt7
# FIXME: more tests
def test_bolt_07_csv():
MessageNamespace(bolt7.csv)
def test_bolt_07_subtypes():
for t in ['{timestamp_node_id_1=1,timestamp_node_id_2=2}']:
vals, _ = bolt7.channel_update_timestamps.val_from_str(t)
assert bolt7.channel_update_timestamps.val_to_str(vals, None) == t