From f115580d301b9ed3621bf8a0f45fbb8ae9317315 Mon Sep 17 00:00:00 2001 From: DinoBektesevic Date: Mon, 5 Aug 2024 11:30:32 -0700 Subject: [PATCH] Adding tests, fixup. --- .../fits_standardizers/test_data_std.py | 2 +- tests/test_end_to_end.py | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/kbmod/standardizers/fits_standardizers/test_data_std.py b/src/kbmod/standardizers/fits_standardizers/test_data_std.py index 7b10af26c..ad21f9a1e 100644 --- a/src/kbmod/standardizers/fits_standardizers/test_data_std.py +++ b/src/kbmod/standardizers/fits_standardizers/test_data_std.py @@ -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"] diff --git a/tests/test_end_to_end.py b/tests/test_end_to_end.py index 799d46158..50eb59203 100644 --- a/tests/test_end_to_end.py +++ b/tests/test_end_to_end.py @@ -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)