code: def test_custom_posts_put_in_own_dir(self):
      silent_f2p = mute(True)(fields2pelican)
      test_posts = []
      for post in self.custposts:
          # check post kind
          if post[8] == "article" or post[8] == "page":
              pass
          else:
              test_posts.append(post)
      with temporary_folder() as temp:
          fnames = list(
              silent_f2p(test_posts, "markdown", temp, wp_custpost=True)
          )
      index = 0
      for post in test_posts:
          name = post[2]
          kind = post[8]
          name += ".md"
          filename = os.path.join(kind, name)
          out_name = fnames[index]
          self.assertTrue(out_name.endswith(filename))
          index += 1
  
imports: import os
  import re
  from posixpath import join
  from unittest.mock import patch
  from pelican.settings import DEFAULT_CONFIG
  from pelican.tests.support import mute, skipIfNoExecutable, temporary_folder, unittest, TestCaseWithCLocale
  from pelican.tools.pelican_import import blogger2fields, build_header, build_markdown_header, decode_wp_content, download_attachments, fields2pelican, get_attachments, tumblr2fields, wp2fields
  from pelican.utils import path_to_file_url, slugify
label_desc: Use image node_id 8 for calling the TestWordpressXmlImporter obj's underlying member method code with example usage: obj.test_custom_posts_put_in_own_dir() without return types