code: def test_directory_has_theme_file(self) -> None:
      doc = Document()
  
      def load(filename: str):
          handler = bahd.DirectoryHandler(filename=filename)
          handler.modify_document(doc)
          if handler.failed:
              raise RuntimeError(handler.error)
  
      custom_theme = """
  attrs:
      AnotherModelInTestDirectoryTheme:
          bar: 42
      SomeModelInTestDirectoryTheme:
          foo: 14
  """
  
      with_directory_contents(
          {
              "main.py": script_adds_two_roots(
                  "SomeModelInTestDirectoryTheme",
                  "AnotherModelInTestDirectoryTheme",
              )
              + """
  # we're testing that the script can override the theme
  some = next(m for m in curdoc().roots if isinstance(m, SomeModelInTestDirectoryTheme))
  some.foo = 57
              """,
              "theme.yaml": custom_theme,
          },
          load,
      )
  
      assert len(doc.roots) == 2
      some_model = next(
          m
          for m in doc.roots
          if m.__class__.__name__ == "SomeModelInTestDirectoryTheme"
      )
      another_model = next(
          m
          for m in doc.roots
          if m.__class__.__name__ == "AnotherModelInTestDirectoryTheme"
      )
      assert another_model.bar == 42
      assert some_model.foo == 57
      # test that we use the theme if we delete our explicit-set value
      del some_model.foo
      assert some_model.foo == 14
      # test that removing the theme gets us back to the base
      doc.theme = None
      assert some_model.foo == 2
      assert another_model.bar == 1
  
imports: from __future__ import annotations
  import pytest
  from typing import TYPE_CHECKING
  import jinja2
  from bokeh.core.templates import FILE
  from bokeh.document import Document
  from tests.support.util.filesystem import with_directory_contents
  import bokeh.application.handlers.directory
label_desc: Use image node_id 8 for calling the Test_DirectoryHandler obj's underlying member method code with example usage: obj.test_directory_has_theme_file() without return types