def test_casudet_is_unchanged(fname): assert not is_sorted(fname) with fits.open(fname) as infile: expected = infile['casudet'].data[0] resort(fname) with fits.open(fname) as infile: flux = infile['casudet'].data[0] assert (flux == expected).all()
def test_flux_is_sorted(fname): assert not is_sorted(fname) with fits.open(fname) as infile: tmid = infile['imagelist'].data['tmid'] flux = infile['flux'].data[0] zipped = zip(tmid, flux) expected = sorted(zipped, key=lambda row: row[0]) resort(fname) with fits.open(fname) as infile: tmid = infile['imagelist'].data['tmid'] flux = infile['flux'].data[0] zipped = zip(tmid, flux) assert zipped == expected
def test_resort_imagelist(fname): assert not is_sorted(fname) resort(fname) assert is_sorted(fname)