Skip to content

Commit

Permalink
Fix quantity comparison test for iraf loader
Browse files Browse the repository at this point in the history
  • Loading branch information
nmearl authored and Simon Torres committed Aug 7, 2019
1 parent 1ded18a commit 8f5511d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions specutils/tests/test_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from astropy.wcs import FITSFixedWarning
from astropy.io.registry import IORegistryError
from astropy.modeling import models

from astropy.tests.helper import quantity_allclose

from numpy.testing import assert_allclose

Expand Down Expand Up @@ -166,8 +166,11 @@ def test_iraf_linear(remote_data_path):
spectrum_1d = Spectrum1D.read(remote_data_path, format='iraf')

assert isinstance(spectrum_1d, Spectrum1D)
assert spectrum_1d.wavelength[0] == u.Quantity(3514.56625402, unit='Angstrom')
assert spectrum_1d.wavelength[100] == u.Quantity(3514.56625402, unit='Angstrom') + u.Quantity(0.653432383823 * 100, unit='Angstrom')
assert quantity_allclose(spectrum_1d.wavelength[0],
u.Quantity(3514.56625402, unit='Angstrom'))
assert quantity_allclose(spectrum_1d.wavelength[100],
u.Quantity(3514.56625402, unit='Angstrom') +
u.Quantity(0.653432383823 * 100, unit='Angstrom'))


@remote_access([{'id':'3359180', 'filename':'log-linear_fits_solution.fits'}])
Expand Down Expand Up @@ -220,4 +223,4 @@ def test_iraf_non_linear_linear_spline(remote_data_path):
def test_iraf_non_linear_cubic_spline(remote_data_path):

with pytest.raises(NotImplementedError):
assert Spectrum1D.read(remote_data_path, format='iraf')
assert Spectrum1D.read(remote_data_path, format='iraf')

0 comments on commit 8f5511d

Please sign in to comment.