docstr: 测试 path 是文件夹；
docstr_tok: ["\u6d4b\u8bd5","path","\u662f\u6587\u4ef6\u5939\uff1b"]
code: def test_add_file_4(self):
      """
      测试 path 是文件夹；
      """
      path = Path(tempfile.mkdtemp())
      try:
          handler = logger.add_file(path)
          logger.info(self.msg)
  
          cur_datetime = str(
              datetime.datetime.now().strftime("%Y-%m-%d")
          )
          for file in path.iterdir():
              if file.name.startswith(cur_datetime):
                  with open(file, "r") as f:
                      line = "".join([l for l in f])
                  assert self.msg in line
      finally:
          rank_zero_rm(path)
  
imports: import os
  import tempfile
  import datetime
  from pathlib import Path
  import logging
  import re
  import pytest
  from fastNLP.envs.env import FASTNLP_LAUNCH_TIME
  from fastNLP.envs.distributed import rank_zero_rm
  from fastNLP.core.log.logger import logger
  from tests.helpers.utils import magic_argv_env_context, recover_logger
label_desc: Use image node_id 4 for calling the TestLogger obj's underlying member method code with example usage: obj.test_add_file_4() without return types