class_docstr: Test zipapp module functionality.
class_docstr_tok: ["Test","zipapp","module","functionality","."]
code: def test_create_sorted_archive(self):
      # Test that zipapps order their files by name
      source = self.tmpdir / "source"
      source.mkdir()
      (source / "zed.py").touch()
      (source / "bin").mkdir()
      (source / "bin" / "qux").touch()
      (source / "bin" / "baz").touch()
      (source / "__main__.py").touch()
      target = io.BytesIO()
      zipapp.create_archive(str(source), target)
      target.seek(0)
      with zipfile.ZipFile(target, "r") as zf:
          self.assertEqual(
              zf.namelist(),
              ["__main__.py", "bin/", "bin/baz", "bin/qux", "zed.py"],
          )
  
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 5 for calling the ZipAppTest obj's underlying member method code with example usage: obj.test_create_sorted_archive() without return types