class_docstr: Test zipapp module functionality.
class_docstr_tok: ["Test","zipapp","module","functionality","."]
code: def test_create_archive_with_compression(self):
      # Test packing a directory into a compressed archive.
      source = self.tmpdir / "source"
      source.mkdir()
      (source / "__main__.py").touch()
      (source / "test.py").touch()
      target = self.tmpdir / "source.pyz"
  
      zipapp.create_archive(source, target, compressed=True)
      with zipfile.ZipFile(target, "r") as z:
          for name in ("__main__.py", "test.py"):
              self.assertEqual(
                  z.getinfo(name).compress_type, zipfile.ZIP_DEFLATED
              )
  
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 9 for calling the ZipAppTest obj's underlying member method code with example usage: obj.test_create_archive_with_compression() without return types