mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-10-29 17:22:42 +00:00
tests: do not hardcode file suffix lengths
This will become useful for XLS -> XLSX conversion. Change-Id: I025e4c24d00526d3bb48c23dcbdc82a65be9a477
This commit is contained in:
@@ -92,7 +92,7 @@ def test_auto_design_generation_fromxlsgainmode(xls_input, expected_json_output)
|
||||
build_network(network, equipment, p_db, p_total_db)
|
||||
save_network(xls_input, network)
|
||||
|
||||
actual_json_output = f'{str(xls_input)[0:len(str(xls_input))-4]}_auto_design.json'
|
||||
actual_json_output = xls_input.with_name(xls_input.stem + '_auto_design').with_suffix('.json')
|
||||
|
||||
with open(actual_json_output, encoding='utf-8') as f:
|
||||
actual = load(f)
|
||||
@@ -132,7 +132,7 @@ def test_auto_design_generation_fromjson(json_input, expected_json_output):
|
||||
build_network(network, equipment, p_db, p_total_db)
|
||||
save_network(json_input, network)
|
||||
|
||||
actual_json_output = f'{str(json_input)[0:len(str(json_input))-5]}_auto_design.json'
|
||||
actual_json_output = json_input.with_name(json_input.stem + '_auto_design').with_suffix('.json')
|
||||
|
||||
with open(actual_json_output, encoding='utf-8') as f:
|
||||
actual = load(f)
|
||||
@@ -159,7 +159,7 @@ def test_excel_service_json_generation(xls_input, expected_json_output):
|
||||
"""
|
||||
convert_service_sheet(xls_input, eqpt_filename)
|
||||
|
||||
actual_json_output = f'{str(xls_input)[:-4]}_services.json'
|
||||
actual_json_output = xls_input.with_name(xls_input.stem + '_services').with_suffix('.json')
|
||||
with open(actual_json_output, encoding='utf-8') as f:
|
||||
actual = load(f)
|
||||
unlink(actual_json_output)
|
||||
|
||||
Reference in New Issue
Block a user