Code Duplication    Length = 18-19 lines in 2 locations

tests/integration/test_paths_metadata.py 2 locations

@@ 291-309 (lines=19) @@
288
                values.append(meta_data[attr])
289
        return values
290
291
    def test_path_constrained_bandwidth_detailed(self):
292
        """Tests if the edges used in the paths
293
        from User 1 to User 2 have at least 20 bandwidth.
294
        """
295
        requirements = {"bandwidth": 20}
296
297
        self.initializer()
298
299
        paths = self.graph.constrained_k_shortest_paths(
300
            "User1", "User2", mandatory_metrics=requirements
301
        )
302
        assert paths
303
304
        for path in paths:
305
            bandwidths = self.links_metadata_values(path, "bandwidth")
306
            assert bandwidths
307
308
            for bandwidth in bandwidths:
309
                assert bandwidth >= requirements["bandwidth"]
310
311
    def test_path_constrained_bandwidth_detailed_t2(self):
312
        """Tests if the edges used in the paths
@@ 311-328 (lines=18) @@
308
            for bandwidth in bandwidths:
309
                assert bandwidth >= requirements["bandwidth"]
310
311
    def test_path_constrained_bandwidth_detailed_t2(self):
312
        """Tests if the edges used in the paths
313
        from User 1 to User 2 have at least 20 bandwidth.
314
        """
315
        requirements = {"bandwidth": 20}
316
317
        self.initializer(val=2)
318
319
        paths = self.graph.constrained_k_shortest_paths(
320
            "User1", "User2", mandatory_metrics=requirements
321
        )
322
        assert paths
323
324
        for path in paths:
325
            bandwidths = self.links_metadata_values(path, "bandwidth")
326
            assert bandwidths
327
            for bandwidth in bandwidths:
328
                assert bandwidth >= requirements["bandwidth"]
329
330
    def test_path_constrained_bandwidth_delay(self):
331
        """Tests if the edges used in the paths from User 1