mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-11-01 18:47:48 +00:00
second set of modification due to codacy report
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
This commit is contained in:
@@ -407,8 +407,8 @@ def main(args):
|
||||
# mess the computation: better to stop the computation
|
||||
all_ids = [r.request_id for r in rqs]
|
||||
if len(all_ids) != len(set(all_ids)):
|
||||
for a in list(set(all_ids)):
|
||||
all_ids.remove(a)
|
||||
for item in list(set(all_ids)):
|
||||
all_ids.remove(item)
|
||||
msg = f'Requests id {all_ids} are not unique'
|
||||
LOGGER.critical(msg)
|
||||
exit()
|
||||
@@ -501,8 +501,8 @@ def main(args):
|
||||
temp = path_result_json(result)
|
||||
fnamecsv = f'{str(args.output)[0:len(str(args.output))-len(str(args.output.suffix))]}.csv'
|
||||
fnamejson = f'{str(args.output)[0:len(str(args.output))-len(str(args.output.suffix))]}.json'
|
||||
with open(fnamejson, 'w', encoding='utf-8') as f:
|
||||
f.write(dumps(path_result_json(result), indent=2, ensure_ascii=False))
|
||||
with open(fnamejson, 'w', encoding='utf-8') as fjson:
|
||||
fjson.write(dumps(path_result_json(result), indent=2, ensure_ascii=False))
|
||||
with open(fnamecsv, "w", encoding='utf-8') as fcsv:
|
||||
jsontocsv(temp, equipment, fcsv)
|
||||
print('\x1b[1;34;40m'+f'saving in {args.output} and {fnamecsv}'+ '\x1b[0m')
|
||||
|
||||
@@ -26,3 +26,4 @@ class DisjunctionError(ServiceError):
|
||||
|
||||
class SpectrumError(Exception):
|
||||
'''Spectrum errors of the program'''
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ def test_disjunction(net,eqpt,serv):
|
||||
p_total_db = p_db + lin2db(automatic_nch(equipment['SI']['default'].f_min,\
|
||||
equipment['SI']['default'].f_max, equipment['SI']['default'].spacing))
|
||||
build_network(network, equipment, p_db, p_total_db)
|
||||
oms_list = build_oms_list(network, equipment)
|
||||
build_oms_list(network, equipment)
|
||||
|
||||
rqs = requests_from_json(data, equipment)
|
||||
rqs = correct_route_list(network, rqs)
|
||||
@@ -81,7 +81,7 @@ def test_does_not_loop_back(net,eqpt,serv):
|
||||
p_total_db = p_db + lin2db(automatic_nch(equipment['SI']['default'].f_min,\
|
||||
equipment['SI']['default'].f_max, equipment['SI']['default'].spacing))
|
||||
build_network(network, equipment, p_db, p_total_db)
|
||||
oms_list = build_oms_list(network, equipment)
|
||||
build_oms_list(network, equipment)
|
||||
|
||||
rqs = requests_from_json(data, equipment)
|
||||
rqs = correct_route_list(network, rqs)
|
||||
|
||||
@@ -323,6 +323,7 @@ def test_json_response_generation(xls_input, expected_response_file):
|
||||
try:
|
||||
temp_result = {
|
||||
'response': Result_element(my_rq, pth, reversed_propagatedpths[i]).json}
|
||||
print(temp_result)
|
||||
except ServiceError:
|
||||
error_handled = True
|
||||
if error_handled:
|
||||
|
||||
Reference in New Issue
Block a user