From 0d7a99197d0b82ae63b32b417b985d713c2a3450 Mon Sep 17 00:00:00 2001 From: Artur Baruchi Date: Wed, 14 Sep 2016 13:58:23 -0300 Subject: [PATCH] Added unit tests for FlowStats and FlowStatsRequest - Issue #158 --- .../test_controller2switch/test_flow_stats.py | 15 +++++++++++++++ .../test_flow_stats_request.py | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/v0x04/test_controller2switch/test_flow_stats.py create mode 100644 tests/v0x04/test_controller2switch/test_flow_stats_request.py diff --git a/tests/v0x04/test_controller2switch/test_flow_stats.py b/tests/v0x04/test_controller2switch/test_flow_stats.py new file mode 100644 index 000000000..54f6393db --- /dev/null +++ b/tests/v0x04/test_controller2switch/test_flow_stats.py @@ -0,0 +1,15 @@ +"""Flow stats message.""" +from pyof.v0x04.controller2switch.common import FlowStats +from tests.test_struct import TestStruct + + +class TestFlowStats(TestStruct): + """Flow stats message.""" + + @classmethod + def setUpClass(cls): + """Configure raw file and its object in parent class (TestDump).""" + super().setUpClass() + super().set_raw_dump_file('v0x04', 'ofpt_flow_stats') + super().set_raw_dump_object(FlowStats) + super().set_minimum_size(56) diff --git a/tests/v0x04/test_controller2switch/test_flow_stats_request.py b/tests/v0x04/test_controller2switch/test_flow_stats_request.py new file mode 100644 index 000000000..bdcf49200 --- /dev/null +++ b/tests/v0x04/test_controller2switch/test_flow_stats_request.py @@ -0,0 +1,15 @@ +"""Flow stats request message.""" +from pyof.v0x04.controller2switch.common import FlowStatsRequest +from tests.test_struct import TestStruct + + +class FlowStatsRequest(TestStruct): + """Flow stats request message.""" + + @classmethod + def setUpClass(cls): + """Configure raw file and its object in parent class (TestDump).""" + super().setUpClass() + super().set_raw_dump_file('v0x04', 'ofpt_flow_stats_request') + super().set_raw_dump_object(FlowStatsRequest) + super().set_minimum_size(40)