code: def test_watch_dir_kwarg_plumbing(self, mock_event_watcher):
      # NOTE: We only test kwarg plumbing for watch_dir since watcher_class
      # selection is tested extensively in test_watch_file, and the two
      # functions are otherwise identical.
      on_file_changed = Mock()
  
      watching_dir = watch_dir(
          "some/dir/path",
          on_file_changed,
          watcher_type="watchdog",
          glob_pattern="*.py",
          allow_nonexistent=True,
      )
  
      self.assertTrue(watching_dir)
      mock_event_watcher.assert_called_with(
          "some/dir/path",
          on_file_changed,
          glob_pattern="*.py",
          allow_nonexistent=True,
      )
  
file_path: streamlit/lib/tests/streamlit/watcher/path_watcher_test.py
imports: import unittest
  from unittest.mock import Mock, call, patch
  import streamlit.watcher.path_watcher
  from streamlit.watcher.path_watcher import NoOpPathWatcher, get_default_path_watcher_class, watch_dir, watch_file
  from tests.testutil import patch_config_options
label_desc: Use image node_id 4 for calling the FileWatcherTest obj's underlying member method code with example usage: obj.test_watch_dir_kwarg_plumbing(mock_event_watcher) without return types