diff options
author | YAMAMOTO Takashi <yamamoto@valinux.co.jp> | 2013-07-02 11:13:49 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2013-07-12 06:51:02 +0900 |
commit | 152e2283501e5c152aba74511b5768b7390f977b (patch) | |
tree | 008cb28841a9ae937d8534a502578b37a778697a | |
parent | 41877dac0b7aef2104ccce95c9606ac25c034e24 (diff) |
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>
-rw-r--r-- | ryu/tests/unit/ofproto/test_parser_v12.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ryu/tests/unit/ofproto/test_parser_v12.py b/ryu/tests/unit/ofproto/test_parser_v12.py index 259850e5..293b810c 100644 --- a/ryu/tests/unit/ofproto/test_parser_v12.py +++ b/ryu/tests/unit/ofproto/test_parser_v12.py @@ -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, |