class_docstr: Test zipapp module functionality.
class_docstr_tok: ["Test","zipapp","module","functionality","."]
code: def test_main_validation(self):
      # Test that invalid values for main are rejected.
      source = self.tmpdir / "source"
      source.mkdir()
      target = self.tmpdir / "source.pyz"
      problems = [
          "",
          "foo",
          "foo:",
          ":bar",
          "12:bar",
          "a.b.c.:d",
          ".a:b",
          "a:b.",
          "a:.b",
          "a:silly name",
      ]
      for main in problems:
          with self.subTest(main=main):
              with self.assertRaises(zipapp.ZipAppError):
                  zipapp.create_archive(
                      str(source), str(target), main=main
                  )
  
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 14 for calling the ZipAppTest obj's underlying member method code with example usage: obj.test_main_validation() without return types