'Tests that a DAG run succeeds when all tasks are skipped'

def test_dagrun_success_when_all_skipped(self):

    dag = DAG(dag_id=u'test_dagrun_success_when_all_skipped', start_date=datetime.datetime(2017, 1, 1))
    dag_task1 = ShortCircuitOperator(task_id=u'test_short_circuit_false', dag=dag, python_callable=(lambda : False))
    dag_task2 = DummyOperator(task_id=u'test_state_skipped1', dag=dag)
    dag_task3 = DummyOperator(task_id=u'test_state_skipped2', dag=dag)
    dag_task1.set_downstream(dag_task2)
    dag_task2.set_downstream(dag_task3)
    initial_task_states = {u'test_short_circuit_false': State.SUCCESS, u'test_state_skipped1': State.SKIPPED, u'test_state_skipped2': State.SKIPPED}
    dag_run = self.create_dag_run(dag=dag, state=State.RUNNING, task_states=initial_task_states)
    updated_dag_state = dag_run.update_state()
    self.assertEqual(State.SUCCESS, updated_dag_state)
