unit tests faile because of missing data locations, e.g. /vsimem/

Issue #772 resolved
Benjamin Jakimow created an issue

Several tests fail because they await local folders or files that do not exist, e.g. c:/vsimem/' or D:/data/sensors

If tests required data that is not part of the EnMAP Box example or unit-test data, they should be skipped if such local data does not exists.

Relates to #769

Example:

enmapboxprocessing/test/algorithm/test_AppendEnviHeaderToGTiffRasterAlgorithm.py

RuntimeError: Attempt to create file `c:/vsimem/enmap.bsq' failed.

test_GeolocateRasterAlgorithm

Traceback (most recent call last):
  File "D:\Repositories\enmap-box\enmapboxprocessing\test\algorithm\test_GeolocateRasterAlgorithm.py", line 26, in test_prisma
    result = self.runalg(alg, parameters)
  File "D:\OSGeo4W\apps\qgis-dev\python\plugins\processing\core\Processing.py", line 162, in runAlgorithm
    ret, results = execute(alg, parameters, context, feedback, catch_exceptions=False)
  File "D:\OSGeo4W\apps\qgis-dev\python\plugins\processing\gui\AlgorithmExecutor.py", line 71, in execute
    results, ok = alg.run(parameters, context, feedback, {}, False)
_core.QgsProcessingException: Traceback (most recent call last):
  File "D:\Repositories\enmap-box\site-packages\typeguard\__init__.py", line 903, in wrapper
    retval = func(*args, **kwargs)
  File "D:\Repositories\enmap-box\enmapboxprocessing\algorithm\geolocaterasteralgorithm.py", line 98, in processAlgorithm
    with open(filename + '.log', 'w') as logfile:
FileNotFoundError: [Errno 2] No such file or directory: 'c:/vsimem/landcoverOrig.vrt.log'

Comments (3)

  1. Andreas Janz

    Product import unittests are now skipped if locale product folder not exists.

    Please test if that is working for you.

  2. Log in to comment