code: def test_watches_direct_symlinks(
      self, dest_docs_dir, origin_dir, tmp_dir
  ):
      try:
          Path(origin_dir, "docs").symlink_to(
              dest_docs_dir, target_is_directory=True
          )
          Path(origin_dir, "mkdocs.yml").symlink_to(
              Path(tmp_dir, "mkdocs.yml")
          )
      except NotImplementedError:  # PyPy on Windows
          self.skipTest("Creating symlinks not supported")
  
      started_building = threading.Event()
  
      def wait_for_build():
          result = started_building.wait(timeout=10)
          started_building.clear()
          with self.assertLogs("mkdocs.livereload"):
              do_request(server, "GET /")
          return result
  
      with testing_server(tmp_dir, started_building.set) as server:
          server.watch(Path(origin_dir, "docs"))
          server.watch(Path(origin_dir, "mkdocs.yml"))
          time.sleep(0.01)
  
          Path(origin_dir, "unrelated.md").write_text("foo")
          self.assertFalse(started_building.wait(timeout=0.5))
  
          Path(tmp_dir, "mkdocs.yml").write_text("edited")
          self.assertTrue(wait_for_build())
  
          Path(dest_docs_dir, "subdir", "foo.md").write_text("edited")
          self.assertTrue(wait_for_build())
  
imports: import contextlib
  import email
  import io
  import sys
  import threading
  import time
  import unittest
  from pathlib import Path
  from unittest import mock
  from mkdocs.livereload import LiveReloadServer
  from mkdocs.tests.base import change_dir, tempdir
label_desc: Use image node_id 25 for calling the BuildTests obj's underlying member method code with example usage: obj.test_watches_direct_symlinks(dest_docs_dir, origin_dir, tmp_dir) and returns: result