This method is used in DagFileProcessor.process_file - it may be easier to migrate all it's internal calls instead of the whole method.
mock.call(mock.ANY, processor_subdir=None, session=mock.ANY),
                mock.call(mock.ANY, processor_subdir=None, session=mock.ANY),
            ]
        )
        
        mock_session.rollback.assert_has_calls([mock.call(), mock.call()])
        
        
        
        mock_s10n_write_dag.assert_has_calls(
            [
                mock.call(mock_dag, min_update_interval=mock.ANY, session=mock_session),
            ]
        )
    @patch("airflow.models.dagbag.settings.MIN_SERIALIZED_DAG_UPDATE_INTERVAL", 5)
    def test_sync_to_db_syncs_dag_specific_perms_on_update(self):
        """
        Test that dagbag.sync_to_db will sync DAG specific permissions when a DAG is
        new or updated
        """
        db_clean_up()
        session = settings.Session()
        with time_machine.travel(tz.datetime(2020, 1, 5, 0, 0, 0), tick=False) as frozen_time:
            dagbag = DagBag(
                dag_folder=os.path.join(TEST_DAGS_FOLDER, "test_example_bash_operator.py"),
                include_examples=False,
            )
            mock_sync_perm_for_dag = mock.MagicMock()
            dagbag._sync_perm_for_dag = mock_sync_perm_for_dag
            def _sync_to_db():