summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYusuke Iwase <iwase.yusuke0@gmail.com>2015-09-10 15:50:14 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-09-15 17:02:16 +0900
commit5cda019b3cf326dc27fc2d12ab103e3322453fee (patch)
tree8756dd124c58f04875dfbfc8fe817840dae564df
parentb874ae839dcd19c13d10d84208cf75908ce70cf8 (diff)
test_parser_v10: Add test case for __getitem__ of OFPMatch
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/tests/unit/ofproto/test_parser_v10.py17
1 files changed, 17 insertions, 0 deletions
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