Skip to content

Commit

Permalink
Added tests for .fits.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSkyentist committed Jul 13, 2024
1 parent f7236c3 commit cb9656e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions fitsmap/tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,27 @@ def test_get_array_fits():

np.testing.assert_equal(expected_array, actual_array[:])

@pytest.mark.unit
@pytest.mark.convert
def test_get_array_fits_gz():
"""Test convert.get_array"""

helpers.setup()

# make test array
tmp = np.zeros((3, 3), dtype=np.float32)
out_path = os.path.join(helpers.TEST_PATH, "test.fits.gz")
fits.PrimaryHDU(data=tmp).writeto(out_path)

pads = [[0, 1], [0, 1]]
expected_array = np.pad(tmp, pads, mode="constant", constant_values=np.nan)

# get test array
actual_array = convert.get_array(out_path)

helpers.tear_down()

np.testing.assert_equal(expected_array, actual_array[:])

@pytest.mark.unit
@pytest.mark.convert
Expand Down

0 comments on commit cb9656e

Please sign in to comment.