Commit b02785fa authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed test_locks.

parent 7da79227
......@@ -148,7 +148,7 @@ class Scene_finder(object):
"""Filter reference scene with the same scene ID like the target scene."""
GDF = self.GDF_ref_scenes
if not GDF.empty:
self.logger.info('Excluding scene with the same ID like the target scene.')
self.logger.info('Same ID filter: Excluding scene with the same ID like the target scene.')
self.GDF_ref_scenes = GDF.loc[GDF['sceneid'] != self.sceneID_excluded]
self.logger.info('%s scenes => %s scenes' % (len(GDF), len(self.GDF_ref_scenes)))
......@@ -156,7 +156,8 @@ class Scene_finder(object):
"""Filter all scenes with less spatial overlap than self.min_overlap."""
GDF = self.GDF_ref_scenes
if not GDF.empty:
self.logger.info('Excluding all scenes with less than %s percent spatial overlap.' % self.min_overlap)
self.logger.info('Overlap filter: Excluding all scenes with less than %s percent spatial overlap.'
% self.min_overlap)
self.GDF_ref_scenes = GDF.loc[GDF['overlap percentage'] >= self.min_overlap]
self.logger.info('%s scenes => %s scenes' % (len(GDF), len(self.GDF_ref_scenes)))
......@@ -164,8 +165,8 @@ class Scene_finder(object):
"""Filter all scenes that have not been processed before according to proc. status (at least L1A is needed)."""
GDF = self.GDF_ref_scenes
if not GDF.empty:
self.logger.info('Exclude all scenes that have not been processed before according to processing status '
'(at least L1A is needed).')
self.logger.info('Processing level filter: Exclude all scenes that have not been processed before '
'according to processing status (at least L1A is needed).')
self.GDF_ref_scenes = GDF[GDF['proc_level'].notnull()]
self.logger.info('%s scenes => %s scenes' % (len(GDF), len(self.GDF_ref_scenes)))
......@@ -173,7 +174,7 @@ class Scene_finder(object):
"""Filter all scenes where no processed data can be found on fileserver."""
GDF = self.GDF_ref_scenes
if not GDF.empty:
self.logger.info('Excluding all scenes where no processed data have been found.')
self.logger.info('Existance filter: Excluding all scenes where no processed data have been found.')
self.GDF_ref_scenes = GDF[GDF['refDs_exists']]
self.logger.info('%s scenes => %s scenes' % (len(GDF), len(self.GDF_ref_scenes)))
......@@ -181,8 +182,8 @@ class Scene_finder(object):
"""Filter all scenes where no proper entity ID can be found in the database (database errors)."""
GDF = self.GDF_ref_scenes
if not GDF.empty:
self.logger.info('Exclude all scenes where no proper entity ID can be found in the database '
'(database errors).')
self.logger.info('DB validity filter: Exclude all scenes where no proper entity ID can be found in the '
'database (database errors).')
self.GDF_ref_scenes = GDF[GDF['entityid'].notnull()]
self.logger.info('%s scenes => %s scenes' % (len(GDF), len(self.GDF_ref_scenes)))
......@@ -194,7 +195,8 @@ class Scene_finder(object):
GDF['prj_equal'] = \
list(GDF['path_ref'].map(lambda path_ref: prj_equal(self.src_prj, GeoArray(path_ref).prj)))
self.logger.info('Exclude all scenes that have a different projection than the target image.')
self.logger.info('Projection filter: Exclude all scenes that have a different projection than the target '
'image.')
self.GDF_ref_scenes = GDF[GDF['prj_equal']]
self.logger.info('%s scenes => %s scenes' % (len(GDF), len(self.GDF_ref_scenes)))
......
......@@ -100,7 +100,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.config.disable_exception_handler = True
with(self.assertRaises(RuntimeError)):
with self.assertRaises(RuntimeError):
self.dummy_gms_mapper_fail(self.PC.config.data_list[0])
def test_exception_handler_receives_failed_object(self):
......
......@@ -29,7 +29,8 @@ class Test_MultiSlotLock(unittest.TestCase):
msl.release()
self.failIf(True in [i.startswith('unittest') for i in msl.existing_locks])
if msl.conn:
self.failIf(True in [i.startswith('unittest') for i in msl.existing_locks])
def test_with_statement(self):
with MultiSlotLock('unittest', allowed_threads=15) as lock:
......@@ -49,7 +50,8 @@ class Test_ProcessLock(unittest.TestCase):
msl.release()
self.failIf(True in [i.startswith('ProcessLock') for i in msl.existing_locks])
if msl.conn:
self.failIf(True in [i.startswith('ProcessLock') for i in msl.existing_locks])
def test_with_statement(self):
with ProcessLock(processes=15) as lock:
......
Markdown is supported
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