"""Unit tests for tasks for the Chartmetric Charts Ingestion Workflow.""" import datetime from feed_ingestion.flows.chartmetric_charts import dates def test_date_range_to_dates(): """Test date_range_to_dates().""" start_date = datetime.date.fromisoformat('2024-02-27') end_date = datetime.date.fromisoformat('2024-03-02') results = list(dates.date_range_to_dates(start_date, end_date)) assert results == [ datetime.date.fromisoformat('2024-02-27'), datetime.date.fromisoformat('2024-02-28'), datetime.date.fromisoformat('2024-02-29'), datetime.date.fromisoformat('2024-03-01'), ]