mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-05 12:26:11 +02:00
test_parser_v12: abuse this to test to_jsondict and from_jsondict
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
41877dac0b
commit
152e228350
@ -6660,6 +6660,16 @@ class TestOFPMatch(unittest.TestCase):
|
||||
if mask and res.fields[0].mask is not None:
|
||||
eq_(res.fields[0].mask, mask)
|
||||
|
||||
# to_jsondict
|
||||
jsondict = match.to_jsondict()
|
||||
|
||||
# from_jsondict
|
||||
match2 = match.from_jsondict(jsondict["OFPMatch"])
|
||||
buf2 = bytearray()
|
||||
match2.serialize(buf2, 0)
|
||||
eq_(str(match), str(match2))
|
||||
eq_(buf, buf2)
|
||||
|
||||
def test_parse_unknown_field(self):
|
||||
buf = bytearray()
|
||||
ofproto_parser.msg_pack_into('!HH', buf, 0, ofproto_v1_2.OFPMT_OXM,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user