Skip to content

Commit afa0e70

Browse files
committed
Update tests for dates in prenight index always being date instances
1 parent 7de24b4 commit afa0e70

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

tests/sim_archive/test_prenightindex.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -212,35 +212,35 @@ def test_get_prenight_index_from_bucket(self) -> None:
212212
# Create a mock prenight index JSON file similar to the sample data
213213
mock_index_data = {
214214
"6c242afb-edd1-4cea-9f8c-80e0a18b4b75": {
215-
"sim_creation_day_obs": "2026-04-11",
215+
"sim_creation_day_obs": date(2026, 4, 11),
216216
"daily_id": 2,
217217
"visitseq_label": "Nominal start and overhead, ideal conditions",
218218
"telescope": "simonyi",
219-
"first_day_obs": "2026-04-11",
220-
"last_day_obs": "2026-04-13",
219+
"first_day_obs": date(2026, 4, 11),
220+
"last_day_obs": date(2026, 4, 13),
221221
"creation_time": "2026-04-11T14:13:55.024Z",
222222
"scheduler_version": "3.21.1",
223223
"sim_runner_kwargs": None,
224224
"conda_env_sha256": "48bcf84e41a741ee67fe644b1ed8d5858d81a7ecfe012473fe2e2f0f3fc05095",
225225
"parent_visitseq_uuid": "94fd43ff-5034-43cd-ac48-6461cdca7979",
226-
"parent_last_day_obs": "2026-04-10",
226+
"parent_last_day_obs": date(2026, 4, 10),
227227
"tags": ["ideal", "nominal", "prenight"],
228228
"comments": {},
229229
"files": {},
230230
},
231231
"b9405aaf-dfe8-4508-ad90-cb37527dbc27": {
232-
"sim_creation_day_obs": "2026-04-11",
232+
"sim_creation_day_obs": date(2026, 4, 11),
233233
"daily_id": 3,
234234
"visitseq_label": "Nominal start and overhead, ideal conditions 2",
235235
"telescope": "simonyi",
236-
"first_day_obs": "2026-04-11",
237-
"last_day_obs": "2026-04-13",
236+
"first_day_obs": date(2026, 4, 11),
237+
"last_day_obs": date(2026, 4, 13),
238238
"creation_time": "2026-04-11T14:21:27.332Z",
239239
"scheduler_version": "3.21.1",
240240
"sim_runner_kwargs": None,
241241
"conda_env_sha256": "48bcf84e41a741ee67fe644b1ed8d5858d81a7ecfe012473fe2e2f0f3fc05095",
242242
"parent_visitseq_uuid": "94fd43ff-5034-43cd-ac48-6461cdca7979",
243-
"parent_last_day_obs": "2026-04-10",
243+
"parent_last_day_obs": date(2026, 4, 10),
244244
"tags": ["ideal", "nominal", "prenight", "rewards"],
245245
"comments": {},
246246
"files": {},
@@ -291,15 +291,15 @@ def test_get_prenight_index_from_bucket(self) -> None:
291291

292292
# Check that the first row has expected data
293293
first_row = result.loc["6c242afb-edd1-4cea-9f8c-80e0a18b4b75"]
294-
self.assertEqual(first_row["sim_creation_day_obs"], "2026-04-11")
294+
self.assertEqual(first_row["sim_creation_day_obs"], date(2026, 4, 11))
295295
self.assertEqual(first_row["daily_id"], 2)
296296
self.assertIn("ideal", first_row["tags"])
297297
self.assertIn("nominal", first_row["tags"])
298298
self.assertIn("prenight", first_row["tags"])
299299

300300
# Check that the second row has expected data
301301
second_row = result.loc["b9405aaf-dfe8-4508-ad90-cb37527dbc27"]
302-
self.assertEqual(second_row["sim_creation_day_obs"], "2026-04-11")
302+
self.assertEqual(second_row["sim_creation_day_obs"], date(2026, 4, 11))
303303
self.assertEqual(second_row["daily_id"], 3)
304304
self.assertIn("ideal", second_row["tags"])
305305
self.assertIn("nominal", second_row["tags"])
@@ -311,18 +311,18 @@ def test_get_prenight_index(self) -> None:
311311
sample_uuid = "6c242afb-edd1-4cea-9f8c-80e0a18b4b75"
312312
mock_result = pd.DataFrame(
313313
{
314-
"sim_creation_day_obs": ["2026-04-11"],
314+
"sim_creation_day_obs": [date(2026, 4, 11)],
315315
"daily_id": [1],
316316
"visitseq_label": ["Test simulation"],
317317
"telescope": ["simonyi"],
318-
"first_day_obs": ["2026-04-11"],
319-
"last_day_obs": ["2026-04-13"],
318+
"first_day_obs": [date(2026, 4, 11)],
319+
"last_day_obs": [date(2026, 4, 13)],
320320
"creation_time": ["2026-04-11T14:13:55.024Z"],
321321
"scheduler_version": ["3.21.1"],
322322
"sim_runner_kwargs": [None],
323323
"conda_env_sha256": ["48bcf84e41a741ee67fe644b1ed8d5858d81a7ecfe012473fe2e2f0f3fc05095"],
324324
"parent_visitseq_uuid": ["94fd43ff-5034-43cd-ac48-6461cdca7979"],
325-
"parent_last_day_obs": ["2026-04-10"],
325+
"parent_last_day_obs": [date(2026, 4, 10)],
326326
"tags": [["ideal", "nominal", "prenight"]],
327327
"comments": [{}],
328328
"files": [{}],

0 commit comments

Comments
 (0)