Commits

consistent error (except) handling, task+test importuvfits, CAS-13121, CAS-13018
No tags

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

Modified
225 225 importuvfits(fitsfile='fake.uvfits', vis='test_set.ms')
226 226 else:
227 227 importuvfits(fitsfile='fake.uvfits', vis='test_set.ms')
228 228 self.assertTrue('failed to verify' in open('testlog.log').read(), msg='Verified a non-existing uvfits')
229 229
230 230 # not talked about in the documentation
231 231 def test_overwrite(self):
232 232 '''test_overwrite: Tests to make sure files aren't overwritten'''
233 233 casalog.setlogfile('testlog.log')
234 234 importuvfits(fitsfile=vlapath, vis='test_set.ms')
235 - importuvfits(fitsfile=vlapath, vis='test_set.ms')
235 + with self.assertRaises(RuntimeError):
236 + importuvfits(fitsfile=vlapath, vis='test_set.ms')
236 237 self.assertTrue('user does not want to remove it.' in open('testlog.log').read(), msg='No warning saying that the file will not overwrite was displayed')
237 238
238 239 def suite():
239 240 return[importuvfits_test]
240 241
241 242 if __name__ == '__main__':
242 243 unittest.main()

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

Add shortcut