class_docstr: Unit tests for SerializedDagModel.
class_docstr_tok: ["Unit","tests","for","SerializedDagModel","."]
docstr: Test Serialized DAG is updated if processor_subdir is changed
docstr_tok: ["Test","Serialized","DAG","is","updated","if","processor_subdir","is","changed"]
code: def test_serialized_dag_is_updated_if_processor_subdir_changed(self):
      """Test Serialized DAG is updated if processor_subdir is changed"""
      example_dags = make_example_dags(example_dags_module)
      example_bash_op_dag = example_dags.get("example_bash_operator")
      dag_updated = SDM.write_dag(
          dag=example_bash_op_dag, processor_subdir="/tmp/test"
      )
      assert dag_updated is True
  
      with create_session() as session:
          s_dag = session.get(SDM, example_bash_op_dag.dag_id)
  
          # Test that if DAG is not changed, Serialized DAG is not re-written and last_updated
          # column is not updated
          dag_updated = SDM.write_dag(
              dag=example_bash_op_dag, processor_subdir="/tmp/test"
          )
          s_dag_1 = session.get(SDM, example_bash_op_dag.dag_id)
  
          assert s_dag_1.dag_hash == s_dag.dag_hash
          assert s_dag.last_updated == s_dag_1.last_updated
          assert dag_updated is False
          session.flush()
  
          # Update DAG
          dag_updated = SDM.write_dag(
              dag=example_bash_op_dag, processor_subdir="/tmp/other"
          )
          s_dag_2 = session.get(SDM, example_bash_op_dag.dag_id)
  
          assert s_dag.processor_subdir != s_dag_2.processor_subdir
          assert dag_updated is True
  
imports: from __future__ import annotations
  from unittest import mock
  import pendulum
  import pytest
  import airflow.example_dags
  from airflow.datasets import Dataset
  from airflow.models.dag import DAG
  from airflow.models.dagbag import DagBag
  from airflow.models.dagcode import DagCode
  from airflow.models.serialized_dag import SerializedDagModel
  from airflow.operators.bash import BashOperator
  from airflow.serialization.serialized_objects import SerializedDAG
  from airflow.settings import json
  from airflow.utils.hashlib_wrapper import md5
  from airflow.utils.session import create_session
  from tests.test_utils import db
  from tests.test_utils.asserts import assert_queries_count
label_desc: Use image node_id 6 for calling the TestSerializedDagModel obj's underlying member method code with example usage: obj.test_serialized_dag_is_updated_if_processor_subdir_changed() without return types