Code Duplication    Length = 13-13 lines in 2 locations

tests/unit/test_main.py 2 locations

@@ 171-183 (lines=13) @@
168
169
        self.assertEqual(json_response, 40)
170
171
    def test_bytes_count_per_flow(self):
172
        """Test bytes_count_per_flow rest call."""
173
        flow_id = "1"
174
        rest_name = "bytes_count/per_flow"
175
        self._patch_switch_flow(flow_id)
176
177
        dpid_id = 111
178
        response = self._get_rest_response(rest_name, dpid_id)
179
180
        json_response = json.loads(response.data)
181
        self.assertEqual(json_response[0]["flow_id"], flow_id)
182
        self.assertEqual(json_response[0]["bytes_counter"], 10)
183
        self.assertEqual(json_response[0]["bits_per_second"], 4.0)
184
185
    def test_bytes_count_sum(self):
186
        """Test bytes_count_sum rest call."""
@@ 145-157 (lines=13) @@
142
        self.assertEqual(json_response["bytes_counter"], 10)
143
        self.assertEqual(json_response["bits_per_second"], 4.0)
144
145
    def test_packet_count_per_flow(self):
146
        """Test packet_count_per_flow rest call."""
147
        flow_id = "1"
148
        rest_name = "packet_count/per_flow"
149
        self._patch_switch_flow(flow_id)
150
151
        dpid_id = 111
152
        response = self._get_rest_response(rest_name, dpid_id)
153
154
        json_response = json.loads(response.data)
155
        self.assertEqual(json_response[0]["flow_id"], flow_id)
156
        self.assertEqual(json_response[0]["packet_counter"], 40)
157
        self.assertEqual(json_response[0]["packet_per_second"], 2.0)
158
159
    def test_packet_count_sum(self):
160
        """Test packet_count_sum rest call."""