Commit 5daf3659 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixes #2.

parent 284ab691
Pipeline #1608 failed with stage
in 10 minutes and 32 seconds
......@@ -13,6 +13,7 @@ from collections import OrderedDict
import multiprocessing
from inspect import getargvalues, stack, getfullargspec, signature, _empty
import json
from json import JSONDecodeError
from jsmin import jsmin
from cerberus import Validator
import pkgutil
......@@ -515,7 +516,14 @@ class JobConfig(object):
# update default options with those from DB
if self.DB_job_record.analysis_parameter:
db_options = json_to_python(json.loads(jsmin(self.DB_job_record.analysis_parameter))) # type: dict
params_dict = json.loads(jsmin(self.DB_job_record.analysis_parameter))
except JSONDecodeError:
warnings.warn('The given JSON options file could not be decoded. JSON decoder failed with the '
'following error:')
db_options = json_to_python(params_dict) # type: dict
if validate:
......@@ -47,12 +47,12 @@ class BaseTest_ExceptionHandler:
raise RuntimeError('TestException raised by dummy_gms_mapper_fail()')
def get_current_progress_stats(self):
return get_info_from_postgreSQLdb(self.PC.job.conn_database, 'jobs', 'statistics',
return get_info_from_postgreSQLdb(self.PC.config.conn_database, 'jobs', 'statistics',
def is_sceneid_in_failedIDs(self, sceneid):
return sceneid in get_info_from_postgreSQLdb(self.PC.job.conn_database, 'jobs', ['failed_sceneids'],
{'id': self.PC.job.ID})[0][0]
return sceneid in get_info_from_postgreSQLdb(self.PC.config.conn_database, 'jobs', ['failed_sceneids'],
{'id': self.PC.config.ID})[0][0]
class Test_ExceptionHandler_NoSubsystems(BaseTest_ExceptionHandler.Test_ExceptionHandler):
......@@ -72,7 +72,7 @@ class Test_ExceptionHandler_NoSubsystems(BaseTest_ExceptionHandler.Test_Exceptio
def test_disabled_exception_handler(self):
"""Check if exception handler raises exceptions of CFG.Job.disable_exception_handler = True."""
self.PC.job.disable_exception_handler = True
self.PC.config.disable_exception_handler = True
self.assertRaises(RuntimeError, self.dummy_gms_mapper_fail, self.PC.config.data_list[0])
......@@ -139,7 +139,7 @@ class BaseTestCases:
self.assertIsInstance(self.L2C_newObjects, list)
self.assertNotEqual(len(self.L2C_newObjects), 0, msg='L2C_processing did not output an L2C object.')
self.assertIsInstance(self.L2C_newObjects[0], L2C_object)
# Setting the job.status manually.
# Setting the config.status manually.
# if self.L2C_newObjects:
# self.PC.config.status = "finished"
# FIXME after updating the job.status-attribute for the level-processes, delete the code that is commented
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment