mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-10-29 17:22:42 +00:00
small test fixes
This commit is contained in:
@@ -3,9 +3,8 @@ python:
|
|||||||
- "3.6"
|
- "3.6"
|
||||||
# command to install dependencies
|
# command to install dependencies
|
||||||
install:
|
install:
|
||||||
- pip install -r requirements.txt
|
- python setup.py install
|
||||||
# command to run tests
|
# command to run tests
|
||||||
before_script:
|
before_script:
|
||||||
- export PYTHONPATH=$PYTHONPATH:/home/travis/build/Orange-OpenSource/gnpy/examples
|
|
||||||
script:
|
script:
|
||||||
- pytest
|
- pytest
|
||||||
|
|||||||
@@ -187,8 +187,8 @@ implementations.
|
|||||||
:alt: Documentation Status
|
:alt: Documentation Status
|
||||||
:scale: 100%
|
:scale: 100%
|
||||||
|
|
||||||
.. |build| image:: https://travis-ci.org/mcantono/gnpy.svg?branch=develop
|
.. |build| image:: https://travis-ci.org/Telecominfraproject/oopt-gnpy.svg?branch=develop
|
||||||
:target: https://travis-ci.org/mcantono/gnpy
|
:target: https://travis-ci.org/Telecominfraproject/oopt-gnpy
|
||||||
:alt: Build Status
|
:alt: Build Status
|
||||||
:scale: 100%
|
:scale: 100%
|
||||||
|
|
||||||
|
|||||||
3
hooks/pre-commit
Executable file
3
hooks/pre-commit
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
exec pytest
|
||||||
BIN
tests/CORONET_Global_Topology.xls
Normal file
BIN
tests/CORONET_Global_Topology.xls
Normal file
Binary file not shown.
@@ -16,6 +16,7 @@ from gnpy.core.convert import convert_file
|
|||||||
from examples.convert_service_sheet import convert_service_sheet
|
from examples.convert_service_sheet import convert_service_sheet
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import filecmp
|
import filecmp
|
||||||
|
from os import unlink
|
||||||
|
|
||||||
|
|
||||||
network_file_name = 'tests/test_network.json'
|
network_file_name = 'tests/test_network.json'
|
||||||
@@ -27,12 +28,12 @@ eqpt_library_name = 'examples/eqpt_config.json'
|
|||||||
# - ..._expected.json for the reference output
|
# - ..._expected.json for the reference output
|
||||||
|
|
||||||
excel_filename = ['tests/excelTestFile.xls',
|
excel_filename = ['tests/excelTestFile.xls',
|
||||||
'examples/CORONET_Global_Topology.xls',
|
'tests/CORONET_Global_Topology.xls',
|
||||||
'tests/meshTopologyExampleV2.xls',
|
'tests/meshTopologyExampleV2.xls',
|
||||||
'tests/meshTopologyExampleV2Eqpt.xls']
|
'tests/meshTopologyExampleV2Eqpt.xls']
|
||||||
network_test_filenames = {
|
network_test_filenames = {
|
||||||
'tests/excelTestFile.xls' : 'tests/excelTestFile_expected.json',
|
'tests/excelTestFile.xls' : 'tests/excelTestFile_expected.json',
|
||||||
'examples/CORONET_Global_Topology.xls': 'tests/CORONET_Global_Topology_expected.json',
|
'tests/CORONET_Global_Topology.xls' : 'tests/CORONET_Global_Topology_expected.json',
|
||||||
'tests/meshTopologyExampleV2.xls' : 'tests/meshTopologyExampleV2_expected.json',
|
'tests/meshTopologyExampleV2.xls' : 'tests/meshTopologyExampleV2_expected.json',
|
||||||
'tests/meshTopologyExampleV2Eqpt.xls' : 'tests/meshTopologyExampleV2Eqpt_expected.json'}
|
'tests/meshTopologyExampleV2Eqpt.xls' : 'tests/meshTopologyExampleV2Eqpt_expected.json'}
|
||||||
@pytest.mark.parametrize("inputfile",excel_filename)
|
@pytest.mark.parametrize("inputfile",excel_filename)
|
||||||
@@ -43,7 +44,9 @@ def test_excel_json_generation(inputfile) :
|
|||||||
# expected
|
# expected
|
||||||
expected_filename = network_test_filenames[inputfile]
|
expected_filename = network_test_filenames[inputfile]
|
||||||
|
|
||||||
assert compare_network_file(expected_filename,json_filename)[0] is True
|
result, _ = compare_network_file(expected_filename, json_filename)
|
||||||
|
unlink(json_filename)
|
||||||
|
assert result
|
||||||
|
|
||||||
# assume json entries
|
# assume json entries
|
||||||
# test that the build network gives correct results
|
# test that the build network gives correct results
|
||||||
@@ -64,4 +67,6 @@ def test_excel_service_json_generation(inputfile) :
|
|||||||
# expected
|
# expected
|
||||||
test_filename = service_test_filenames[inputfile]
|
test_filename = service_test_filenames[inputfile]
|
||||||
|
|
||||||
assert compare_service_file(test_filename,json_filename)[0] is True
|
result, _ = compare_service_file(test_filename, json_filename)
|
||||||
|
unlink(json_filename)
|
||||||
|
assert result
|
||||||
|
|||||||
Reference in New Issue
Block a user