Skip to content

Commit

Permalink
Adding tests, fixup.
Browse files Browse the repository at this point in the history
  • Loading branch information
DinoBektesevic committed Aug 5, 2024
1 parent 1efd9ac commit f115580
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def translateHeader(self):
# required
standardizedHeader = {}
obs_datetime = Time(self.primary["OBS-MJD"], format="mjd")
standardizedHeader["mjd"] = obs_datetime.mjd
standardizedHeader["mjd_mid"] = obs_datetime.mjd
# optional
standardizedHeader["observat"] = self.primary["OBSERVAT"]
standardizedHeader["obs_lat"] = self.primary["OBS-LAT"]
Expand Down
30 changes: 30 additions & 0 deletions tests/test_end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,36 @@
from utils.utils_for_tests import get_absolute_demo_data_path




####
import unittest


from kbmod import ImageCollection
from kbmod.configuration import SearchConfiguration
import kbmod.mocking as kbmock


class TestEmptySearch(unittest.TestCase):
def setUp(self):
self.factory = kbmock.EmptyFits()

def test(self):
hduls = self.factory.mock(n=10)

ic = ImageCollection.fromTargets(hdulist=hduls, force="TestDataStd")
wu = ic.toWorkUnit(search_config=SearchConfiguration())
results = SearchRunner.run_search_from_work_unit(wu)

self.assertTrue(len(results) == 0)




####


# this is the first test to actually test things like get_all_stamps from
# analysis utils. For now stamps have to be RawImages (because methods like
# interpolate and convolve are defined to work on RawImage and not as funciton)
Expand Down

0 comments on commit f115580

Please sign in to comment.