Commit cb8a453b authored by Thomas Vincent's avatar Thomas Vincent

add a test for image_roi

parent 3090e238
......@@ -128,7 +128,7 @@ def run_entry_point(entry_point, argv):
target_name = elements[0].strip()
elements = elements[1].split(":")
module_name = elements[0].strip()
function_name = elements[1].strip()
function_name = elements[1].split()[0].strip()
logger.info("Execute target %s (function %s from module %s) using importlib", target_name, function_name, module_name)
full_args = [target_name]
......
......@@ -112,8 +112,38 @@ class TestMerger(unittest.TestCase):
def test_nominal(self):
"""
"""
manager = self._manager
output_dir = os.path.join(self._tmpTestDir, 'merged')
if os.path.isdir(output_dir):
shutil.rmtree(output_dir)
merger = KmapMerger(self._spec_h5,
self._parser.results,
output_dir=output_dir)
merger.center_chan = 140, 322
merger.chan_per_deg = 318, 318
merger.beam_energy = 8000
self.assertEqual(merger.status, merger.READY, msg=merger.statusMsg)
merger.merge()
self.assertEqual(merger.status, merger.DONE, msg=merger.statusMsg)
summary = merger.summary(fullpath=True)
summary_set = set([merged_f
for merged_f in summary.values()])
expected_set = set([os.path.join(output_dir, merged_f)
for merged_f in self.merged_files])
self.assertEqual(summary_set, expected_set)
exists = all([os.path.isfile(merged_f)
for merged_f in expected_set])
self.assertTrue(exists)
def test_image_roi(self):
"""Run merge with image ROI"""
output_dir = os.path.join(self._tmpTestDir, 'merged')
if os.path.isdir(output_dir):
......@@ -126,6 +156,8 @@ class TestMerger(unittest.TestCase):
merger.chan_per_deg = 318, 318
merger.beam_energy = 8000
merger.image_roi = 10, 20, 30, 300
self.assertEqual(merger.status, merger.READY, msg=merger.statusMsg)
merger.merge()
......
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