示例#1
0
 def test_timezone(self, mock_utcnow, default_timezone, start_date,
                   expected):
     with patch("airflow.settings.TIMEZONE",
                pendulum.timezone(default_timezone)):
         dag = DAG("test", default_args={"start_date": start_date})
         op = TimeSensor(task_id="test", target_time=time(10, 0), dag=dag)
         assert op.poke(None) == expected
 def test_time_sensor(self):
     t = TimeSensor(
         task_id=TEST_TASK_ID,
         target_time=time(0),
         dag=self.dag
     )
     t.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, ignore_ti_state=True)
 def test_time_sensor(self):
     op = TimeSensor(
         task_id=TEST_TASK_ID,
         target_time=time(0),
         dag=self.dag
     )
     op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, ignore_ti_state=True)