I think that gnpy/core/equipment.py should contain only stuff which
prepares the equipment_config, not anything "lower level" that is reused
from other places.
Change-Id: I0cd593fd3e5558178ddd0ad8fff5c596e022894a
- builds correspondance dicts between input name from excel
and names created with convert.py and autodesign in network.py
- correct the corresp_name dicts according to the effective
network autodesign. This supports the case of fiber splitting
and of fused elements
- include the case of parrallel links with only one hop
- interpret the node list constraint given by the user with the dict
- filter the constraints that are not applicable
- add tests for constraints
- correct equipment sheet of mesh_example_topologyv2.xls: morlaix and
loudeac should not appear in node A column since they are fused
ILA and FUSED constraints must be filled with the next node
information in order to avoid confusion on the direction.
for example
eg a----b-----c
| | |
i j k
| | |
e----f-----g
a constraint 'j' given for service i to k leads to 2 possible direction:
i-a-b-j-f-g-k
i-e-f-j-b-c-k
the user must indicate the chossen direction. This ambiguity does not
exist with network input in json format (names are unique).
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ia7cf2026e569c8b566459791fc89546b91fb117c
Using `with pytest.raises` is better than open coding the equivalent
feature. Similarly, when a block is not expected to raise an exception,
let's just let it run outside of a `try` block and rely on the test
framework to report a possible failure when hitting an unhandled
exception.
Change-Id: Icb1bb83e649733b56fcdc9168cabf88c9cf8d478
If request is bidir and 'z-a-path-metric' is missing, raises an error
If present, should not raise an error
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
remove some prints, indicate which from actual or expected key
is printed.
preceise that test is also performed on values
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
add one service only excel file + changes on compare.py to support
no synchronization vector case
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
add aa bidir request to test service error handling
TODO: write more detailed test on the bidir case
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
For this purpose we create a wrong request with M=0 and verify
that serviceError is correctly raised when calling Result_element class
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
function compute_path_with_disjunction needs an additional reversed path
and results must contain wavelength assignment
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
previous comparison was done on the result from .sort(), ie None.
list.sort() method modifies the list in-place and returns None.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
add a no path case (request 6) in requests and expected responses.
response is also generated if path is not feasible: checks
that it is correctly handled in csv and json responses
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
create a json response based on test file and compare it to expected
response.
comparison first checks that there is no missing or extra key
and then compares keys
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
previous test assumed same order for header fields.
order the headers in the same way in order to support different
types of order
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
use
if not condition:
raise AssertionError()
instead of
assert condition
according to codacy recommendation
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
using pandas package to have an easy ordering of response column:
- test that the generated header is as expected
- read the response. In order to support different orders wrt
response answer and field answer, test function frst orders lines
according to response index and then to columns (fields of the answer).
check that the answers are as expected
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
- use the same file to test different configuration: with and without Eqpt sheet defined,
add the abcdfgh topo for disjunction tests in the same file
- change the name of files to avoid mixing with examples/meshTopologyExampleV2.xxx
TODO: test if examples/ files pass for both path_requests_run and trasmission_main_example
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
- update eqpt_config.json to power-mode : false to take into account gain target
of the eqpt sheet
- correct eqpt-config.json with new parameters
- add gain target in meshTopolgyExampleV2Eqpt.xls
- correct test_parser.py test function names
- suppress Exceltestfile
- change power_mode in test_parser to True in eqpt_config.json for all tests
except for parser: changed in the function to False to enable
Eqpt files gain target reading
Next: reduce the number of test files and include examples/ files in the tests
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
- tests if networ autodesign does not change some reference files
- changed the meshTopologyExampleV2 files to account for newest features:
empty columns in mode, power, nb channels, disjuntion examples ...
- added a tsp type with more modes for diversification of tests
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>