From c4235fa61c49b90305329e5e96b5d1e103610c36 Mon Sep 17 00:00:00 2001 From: EstherLerouzic Date: Wed, 12 May 2021 13:07:47 +0200 Subject: [PATCH] Add a test case for the case of 2 adjacent fibers make sure that their loss is not concatenated Signed-off-by: EstherLerouzic Change-Id: I63678dd5b72f7f6984101c4367320f3f981cb573 --- tests/data/bugfixiteratortopo.json | 54 ++++++++++++++++++++++++++++++ tests/test_network_functions.py | 3 ++ 2 files changed, 57 insertions(+) diff --git a/tests/data/bugfixiteratortopo.json b/tests/data/bugfixiteratortopo.json index 0f5c79c6..337938cd 100644 --- a/tests/data/bugfixiteratortopo.json +++ b/tests/data/bugfixiteratortopo.json @@ -53,6 +53,48 @@ } } }, + { + "uid": "fiber7", + "type": "Fiber", + "type_variety": "SSMF", + "params": { + "length": 1.0, + "loss_coef": 0.2, + "length_units": "km", + "att_in": 0, + "con_in": 0.0, + "con_out": 0.0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": null, + "region": null + } + } + }, + { + "uid": "fiber8", + "type": "Fiber", + "type_variety": "SSMF", + "params": { + "length": 60.0, + "loss_coef": 0.2, + "length_units": "km", + "att_in": 0, + "con_in": 0.0, + "con_out": 0.0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": null, + "region": null + } + } + }, { "uid": "fused1", "type": "Fused", @@ -387,6 +429,18 @@ { "from_node": "nodeB", "to_node": "Site_B" + }, + { + "from_node": "nodeA", + "to_node": "fiber7" + }, + { + "from_node": "fiber7", + "to_node": "fiber8" + }, + { + "from_node": "fiber8", + "to_node": "nodeB" } ] } diff --git a/tests/test_network_functions.py b/tests/test_network_functions.py index 1f7c859e..aa8bc246 100644 --- a/tests/test_network_functions.py +++ b/tests/test_network_functions.py @@ -30,6 +30,9 @@ NETWORK_FILENAME = TEST_DIR / 'data/bugfixiteratortopo.json' # fourth span ['fiber6', 17], ['fused7', 17], + # fifth span + ['fiber7', 0.2], + ['fiber8', 12], # all other nodes ['Site_A', 0], ['nodeA', 0],