'Test that fileloc is correctly set when we load example DAGs,
specifically SubDAGs.'

def test_get_dag_fileloc(self):

    dagbag = models.DagBag(include_examples=True)
    expected = {u'example_bash_operator': u'example_bash_operator.py', u'example_subdag_operator': u'example_subdag_operator.py', u'example_subdag_operator.section-1': u'subdags/subdag.py'}
    for (dag_id, path) in expected.items():
        dag = dagbag.get_dag(dag_id)
        self.assertTrue(dag.fileloc.endswith((u'airflow/example_dags/' + path)))
