Skip to content

Commit ca2afe4

Browse files
committed
fix test coverage
1 parent cfe2432 commit ca2afe4

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

tests/test_ImageSimulation/test_roman_image_simulation.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# test_roman_image_simulation.py
12
import astropy.cosmology
23
import numpy as np
34
import numpy.testing as npt
@@ -385,6 +386,14 @@ def test_precompute_roman_background():
385386
assert np.all(np.isfinite(background))
386387
assert np.all(background >= 0)
387388

389+
# testing the randomised-defaults (detector, detector_pos, ra, dec all None)
390+
background_random = precompute_roman_background(
391+
band=BAND,
392+
num_pix=45,
393+
exposure_time=kwargs_single_band["exposure_time"],
394+
)
395+
assert background_random.shape == (45 + 6, 45 + 6)
396+
388397

389398
def test_simulate_roman_image_with_precomputed_background():
390399
kwargs_single_band = image_quality_lenstronomy.kwargs_single_band(
@@ -435,4 +444,4 @@ def test_simulate_roman_image_with_precomputed_background():
435444

436445

437446
if __name__ == "__main__":
438-
pytest.main()
447+
pytest.main()

0 commit comments

Comments
 (0)