From 5cda019b3cf326dc27fc2d12ab103e3322453fee Mon Sep 17 00:00:00 2001 From: Yusuke Iwase Date: Thu, 10 Sep 2015 15:50:14 +0900 Subject: test_parser_v10: Add test case for __getitem__ of OFPMatch Signed-off-by: IWASE Yusuke Signed-off-by: FUJITA Tomonori --- ryu/tests/unit/ofproto/test_parser_v10.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ryu/tests/unit/ofproto/test_parser_v10.py b/ryu/tests/unit/ofproto/test_parser_v10.py index ca47d34e..dca2b470 100644 --- a/ryu/tests/unit/ofproto/test_parser_v10.py +++ b/ryu/tests/unit/ofproto/test_parser_v10.py @@ -220,6 +220,23 @@ class TestOFPMatch(unittest.TestCase): eq_(self.tp_src['val'], res[11]) eq_(self.tp_dst['val'], res[12]) + def test_getitem(self): + c = self._get_obj(self.dl_src, self.dl_dst) + + eq_(self.wildcards['val'], c["wildcards"]) + eq_(self.in_port['val'], c["in_port"]) + eq_(self.dl_src, c["dl_src"]) + eq_(self.dl_dst, c["dl_dst"]) + eq_(self.dl_vlan['val'], c["dl_vlan"]) + eq_(self.dl_vlan_pcp['val'], c["dl_vlan_pcp"]) + eq_(self.dl_type['val'], c["dl_type"]) + eq_(self.nw_tos['val'], c["nw_tos"]) + eq_(self.nw_proto['val'], c["nw_proto"]) + eq_(self.nw_src['val'], c["nw_src"]) + eq_(self.nw_dst['val'], c["nw_dst"]) + eq_(self.tp_src['val'], c["tp_src"]) + eq_(self.tp_dst['val'], c["tp_dst"]) + class TestOFPActionHeader(unittest.TestCase): """ Test case for ofproto_v1_0_parser.OFPActionHeader -- cgit v1.2.3