Code Duplication    Length = 13-13 lines in 2 locations

tests/unit/test_main.py 2 locations

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