code: def test_main():
      def _check_exit(status=0, message=None):
          del message
          assert status == 0  # Check argparse exit gracefully
  
      # Argparse call `sys.exit(0)` when `--version` is passed.
      with mock.patch("sys.exit", _check_exit):
          version_flag = "--version"
          main.main(main._parse_flags(["", version_flag]))
  
label_desc: Use image node_id 1 for calling a global function with example usage: test_main() without return types