Commits

Benjamin Bean authored 86ab3815a9f
update tests for changes in cpp error message
No tags

casa5/gcwrap/python/scripts/tests/test_req_task_deconvolve.py

Modified
2021 2021 self.ivsetup()
2022 2022
2023 2023 # cause the tst.model image to exist prior to looking for it
2024 2024 deconvolve(imagename=self.img, niter=1, restoration=False, **deconvolve_args)
2025 2025
2026 2026 # verify the images have the wrong format and an exception is thrown
2027 2027 # Note: cpp code does not mind that the .pb image has a weird shape
2028 2028 os.system("mv {0}{1} {0}_bak{1}".format(self.img, ext))
2029 2029
2030 2030 imrebin(imagename=self.img+"_bak"+ext, outfile=self.img+ext, factor=[50,50])
2031 - strcheck = "There is a shape mismatch between existing images"
2031 + strcheck = "(There is a shape mismatch between existing images|There is a coordinate system mismatch between existing images on disk and current parameters)"
2032 2032 with self.assertRaisesRegex(RuntimeError, strcheck):
2033 2033 deconvolve(imagename=self.img, niter=10, **deconvolve_args)
2034 2034
2035 2035 # Test 52
2036 2036 # @unittest.skipIf(ParallelTaskHelper.isMPIEnabled(), "Skip test. Cube Parallel Output Can't be used. Revisit after CAS-9386")
2037 2037 def test_imgval_missingimgs_residual(self):
2038 2038 """ [imgval] test_imgval_missingimgs_residual """
2039 2039 ######################################################################################
2040 2040 # tst.residual and tst.psf are always required
2041 2041 ######################################################################################
2360 2360 # cause the tst.model image to exist prior to looking for it
2361 2361 deconvolve(imagename=self.img, niter=1, restoration=False, deconvolver='mtmfs', **deconvolve_args)
2362 2362
2363 2363 # verify the images have the wrong format and an exception is thrown
2364 2364 # Note: cpp code does not mind that the .pb image has a weird axes order
2365 2365 fn1 = self.img + ext + ttn
2366 2366 fn2 = self.img + "_bak" + ext + ttn
2367 2367 os.system("mv {0} {1}".format(fn1, fn2))
2368 2368
2369 2369 imtrans(imagename=self.img+"_bak"+ext+ttn, outfile=self.img+ext+ttn, order="3012")
2370 - strcheck = "There is a shape mismatch between existing images"
2370 + strcheck = "(There is a shape mismatch between existing images|There is a coordinate system mismatch between existing images on disk and current parameters)"
2371 2371 with self.assertRaisesRegex(RuntimeError, strcheck):
2372 2372 deconvolve(imagename=self.img, niter=10, deconvolver='mtmfs', **deconvolve_args)
2373 2373
2374 2374 def helper_mtmfsimgval_shapemismatch(self, ext, ttn=".tt1", deconvolve_args={}):
2375 2375 """All input images should have the same shape as the tst.residual image"""
2376 2376 self.ivsetup()
2377 2377
2378 2378 # cause the tst.model image to exist prior to looking for it
2379 2379 deconvolve(imagename=self.img, niter=1, restoration=False, deconvolver='mtmfs', **deconvolve_args)
2380 2380
2381 2381 # verify the images have the wrong format and an exception is thrown
2382 2382 # Note: cpp code does not mind that the .pb image has a weird shape
2383 2383 os.system("mv {0}{1}{2} {0}_bak{1}{2}".format(self.img, ext, ttn))
2384 2384
2385 2385 imrebin(imagename=self.img+"_bak"+ext+ttn, outfile=self.img+ext+ttn, factor=[2,2])
2386 - strcheck = "There is a shape mismatch between existing images"
2386 + strcheck = "(There is a shape mismatch between existing images|There is a coordinate system mismatch between existing images on disk and current parameters)"
2387 2387 with self.assertRaisesRegex(RuntimeError, strcheck):
2388 2388 deconvolve(imagename=self.img, niter=10, deconvolver='mtmfs', **deconvolve_args)
2389 2389
2390 2390 # Test 71
2391 2391 # @unittest.skipIf(ParallelTaskHelper.isMPIEnabled(), "Skip test. Cube Parallel Output Can't be used. Revisit after CAS-9386")
2392 2392 def test_mtmfsimgval_missingimgs_residual(self):
2393 2393 """ [mtmfsimgval] test_mtmfsimgval_missingimgs_residual """
2394 2394 ######################################################################################
2395 2395 # tst.residual and tst.psf are always required
2396 2396 ######################################################################################

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut