def test_true_condition(self):
     op = BashSensor(task_id='test_true_condition',
                     bash_command='freturn() { return "$1"; }; freturn 0',
                     output_encoding='utf-8',
                     poke_interval=1,
                     timeout=2,
                     dag=self.dag)
     op.execute(None)
 def test_false_condition(self):
     op = BashSensor(task_id='test_false_condition',
                     bash_command='freturn() { return "$1"; }; freturn 1',
                     output_encoding='utf-8',
                     poke_interval=1,
                     timeout=2,
                     dag=self.dag)
     with self.assertRaises(AirflowSensorTimeout):
         op.execute(None)
Ejemplo n.º 3
0
 def test_true_condition(self):
     t = BashSensor(
         task_id='test_true_condition',
         bash_command='freturn() { return "$1"; }; freturn 0',
         output_encoding='utf-8',
         poke_interval=1,
         timeout=2,
         dag=self.dag
     )
     t.execute(None)
Ejemplo n.º 4
0
 def test_false_condition(self):
     t = BashSensor(
         task_id='test_false_condition',
         bash_command='freturn() { return "$1"; }; freturn 1',
         output_encoding='utf-8',
         poke_interval=1,
         timeout=2,
         dag=self.dag
     )
     with self.assertRaises(AirflowSensorTimeout):
         t.execute(None)