class_docstr: Test zipapp module functionality.
class_docstr_tok: ["Test","zipapp","module","functionality","."]
code: def test_create_archive_filter_exclude_dir(self):
      # Test packing a directory and using a filter to exclude a
      # subdirectory (ensures that the path supplied to include
      # is relative to the source location, as expected).
      def skip_dummy_dir(path):
          return path.parts[0] != "dummy"
  
      source = self.tmpdir / "source"
      source.mkdir()
      (source / "__main__.py").touch()
      (source / "test.py").touch()
      (source / "dummy").mkdir()
      (source / "dummy" / "test2.py").touch()
      target = self.tmpdir / "source.pyz"
  
      zipapp.create_archive(source, target, filter=skip_dummy_dir)
      with zipfile.ZipFile(target, "r") as z:
          self.assertEqual(len(z.namelist()), 2)
          self.assertIn("__main__.py", z.namelist())
          self.assertIn("test.py", z.namelist())
  
imports: import io
  import pathlib
  import stat
  import sys
  import tempfile
  import unittest
  import zipapp
  import zipfile
  from test.support import requires_zlib
  from test.support import os_helper
  from unittest.mock import patch
label_desc: Use image node_id 7 for calling the ZipAppTest obj's underlying member method code with example usage: obj.test_create_archive_filter_exclude_dir() and returns: unknown