class_docstr: Unit tests for SerializedDagModel.
class_docstr_tok: ["Unit","tests","for","SerializedDagModel","."]
docstr: DAGs can be read from database.
docstr_tok: ["DAGs","can","be","read","from","database","."]
code: def test_read_dags(self):
      """DAGs can be read from database."""
      example_dags = self._write_example_dags()
      serialized_dags = SDM.read_all_dags()
      assert len(example_dags) == len(serialized_dags)
      for dag_id, dag in example_dags.items():
          serialized_dag = serialized_dags[dag_id]
  
          assert serialized_dag.dag_id == dag.dag_id
          assert set(serialized_dag.task_dict) == set(dag.task_dict)
  
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 7 for calling the TestSerializedDagModel obj's underlying member method code with example usage: obj.test_read_dags() without return types