Commits

Kazuhiko Shimada authored ad24863798d
CAS-13520: modified an assertion logic.

refs #2336
No tags

casatasks/tests/tasks/test_imbaseline.py

Modified
472 472 ms_stack = MeasurementSetStack()
473 473 Image2MSMethods.execute(self.datacolumn, self.image_shape, image_stack, ms_stack)
474 474
475 475 def test_4_5(self):
476 476 """4-5. check Image2MSParams"""
477 477 outfile = 'output_4_5.ms'
478 478 params = Image2MSParams(self.expected, outfile, self.datacolumn, self.image_shape)
479 479 params.validate()
480 480 self.assertEqual(params.infile, self.expected)
481 481 self.assertEqual(params.outfile, outfile)
482 - self.assertTrue(np.all(params.im_shape == self.image_shape.im_shape))
483 - self.assertTrue(np.all(params.axis_dir == self.image_shape.axis_dir))
484 - self.assertTrue(np.all(params.dir_shape == self.image_shape.dir_shape))
485 - self.assertEqual(params.axis_sp, self.image_shape.axis_sp)
486 - self.assertEqual(params.axis_pol, self.image_shape.axis_pol)
487 - self.assertEqual(params.im_nrow, self.image_shape.im_nrow)
488 - self.assertEqual(params.im_nchan, self.image_shape.im_nchan)
489 - self.assertEqual(params.im_npol, self.image_shape.im_npol)
482 + for attr in ('im_shape', 'axis_dir', 'dir_shape'):
483 + self.assertTrue(np.all(getattr(params, attr) == getattr(self.image_shape, attr)))
484 + for attr in ('axis_sp', 'axis_pol', 'im_nrow', 'im_nchan', 'im_npol'):
485 + self.assertEqual(getattr(params, attr), getattr(self.image_shape, attr))
490 486
491 487
492 488 class TestSdsmooth(test_base):
493 489 """Test sdsmooth execution.
494 490
495 491 Tests of sdsmooth rely on ones of test_sdsmooth basically, so we have minimal tests in imbaseline.
496 492
497 493 5-1. simple successful case
498 494 5-2. invalid ms stack
499 495 5-3. invalid image stack

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

Add shortcut