Code Duplication    Length = 33-33 lines in 2 locations

tests/unit/test_utils.py 2 locations

@@ 296-328 (lines=33) @@
293
        result = utils._compare_endpoints(endpoint1, endpoint2)
294
        self.assertFalse(result)
295
296
    def test_compare_endpoints6(self):
297
        """Test for compare endpoinst for the fifth internal conditional."""
298
        endpoint1 = {
299
            "dpid": "00:00:00:00:00:00:00:01",
300
            "in_port": 3,
301
            "out_port": 2,
302
            "out_vlan": 200,
303
        }
304
        endpoint2 = {
305
            "dpid": "00:00:00:00:00:00:00:01",
306
            "in_port": 2,
307
            "out_port": 3,
308
        }
309
310
        # Test endpoint1 with out_vlan and endpoint2 without in_vlan
311
        result = utils._compare_endpoints(endpoint1, endpoint2)
312
        self.assertFalse(result)
313
314
        endpoint1 = {
315
            "dpid": "00:00:00:00:00:00:00:01",
316
            "in_port": 3,
317
            "out_port": 2,
318
        }
319
        endpoint2 = {
320
            "dpid": "00:00:00:00:00:00:00:01",
321
            "in_port": 2,
322
            "out_port": 3,
323
            "in_vlan": 100,
324
        }
325
326
        # Test endpoint1 without out_vlan and endpoint2 with in_vlan
327
        result = utils._compare_endpoints(endpoint1, endpoint2)
328
        self.assertFalse(result)
329
330
    def test_compare_endpoints(self):
331
        """Test for compare endpoinst for the fifth internal conditional."""
@@ 243-275 (lines=33) @@
240
        result = utils._compare_endpoints(endpoint1, endpoint2)
241
        self.assertFalse(result)
242
243
    def test_compare_endpoints4(self):
244
        """Test for compare endpoinst for the first internal conditional."""
245
        endpoint1 = {
246
            "dpid": "00:00:00:00:00:00:00:03",
247
            "in_port": 3,
248
            "out_port": 2,
249
            "in_vlan": 100,
250
        }
251
        endpoint2 = {
252
            "dpid": "00:00:00:00:00:00:00:03",
253
            "in_port": 2,
254
            "out_port": 3,
255
        }
256
257
        # Test endpoint1 with in_vlan and endpoint2 without out_vlan
258
        result = utils._compare_endpoints(endpoint1, endpoint2)
259
        self.assertFalse(result)
260
261
        endpoint1 = {
262
            "dpid": "00:00:00:00:00:00:00:03",
263
            "in_port": 3,
264
            "out_port": 2,
265
        }
266
        endpoint2 = {
267
            "dpid": "00:00:00:00:00:00:00:03",
268
            "in_port": 2,
269
            "out_port": 3,
270
            "out_vlan": 200,
271
        }
272
273
        # Test endpoint1 without in_vlan and endpoint2 with out_vlan
274
        result = utils._compare_endpoints(endpoint1, endpoint2)
275
        self.assertFalse(result)
276
277
    def test_compare_endpoints5(self):
278
        """Test for compare endpoinst for the fifth internal conditional."""