code: def test_dirwatcher_update_policy_on_nonexistent_file_calls_file_changed_when_file_created_iff_policy_now_or_live(
      tempdir: Path,
      file_pusher: FilePusher,
      dir_watcher: DirWatcher,
      policy: "PolicyName",
      expect_called: bool,
  ):
      f = tempdir / "my-file.txt"
      dir_watcher.update_policy(str(f), policy)
  
      write_with_mtime(f, b"content", mtime=0)
  
      file_pusher.file_changed.assert_not_called()
      dir_watcher._on_file_created(Mock(src_path=str(f)))
      assert file_pusher.file_changed.called == expect_called
  
imports: import os
  import tempfile
  import time
  from pathlib import Path
  from typing import TYPE_CHECKING, Callable
  from unittest.mock import Mock, patch
  import pytest
  import wandb.filesync.dir_watcher
  from wandb.filesync.dir_watcher import DirWatcher, PolicyEnd, PolicyLive, PolicyNow
  from wandb.sdk.internal.file_pusher import FilePusher
label_desc: Use image node_id 7 for calling a global function with example usage: test_dirwatcher_update_policy_on_nonexistent_file_calls_file_changed_when_file_created_iff_policy_now_or_live(tempdir, file_pusher, dir_watcher, policy, expect_called) without return types