code: def test_entrypoint(capsys):
      # Check that we handle missing args as expected
      with mock.patch("sys.argv", ["nib-roi", "--help"]):
          try:
              retval = main()
          except SystemExit:
              pass
          else:
              assert (
                  False
              ), "argparse exits on --help. If changing to another parser, update test."
      captured = capsys.readouterr()
      assert captured.out.startswith("usage: nib-roi")
  
file_path: nibabel/nibabel/cmdline/tests/test_roi.py
imports: import os
  import unittest
  from unittest import mock
  import numpy
  import pytest
  import nibabel
  from nibabel.cmdline.roi import lossless_slice, main, parse_slice
  from nibabel.testing import data_path
label_desc: Use image node_id 8 for calling a global function with example usage: test_entrypoint(capsys) without return types