def test2(): '''ASTRODATA-mode TEST 2: Overwrite readonly AD using name change''' ad = AstroData(sci123) outfile = 'testmode2.fits' if os.path.exists(outfile): os.remove(outfile) ad.filename = outfile ad.write() assert_true(os.path.isfile(outfile), 'ad.write() FAIL') os.remove(outfile) ad.close()
def test3(): '''ASTRODATA-mode TEST 3: Clobber unchanged readonly file''' ad = AstroData(sci123) ad.write(clobber=True) assert_true(os.path.isfile(sci123), 'Clobber fail') ad.close()