# Path: tbmodels/_cli.py
# @click.group()
# @click.version_option(version=tbmodels_version)
# def cli():
#     pass


import tempfile
import pytest
import tbmodels
from click.testing import CliRunner
from tbmodels._cli import cli
                "slice",
                "-o",
                out_file.name,
                "-i",
                input_file,
            ]
            + cli_sparsity_arguments
            + cli_verbosity_argument
            + [str(x) for x in slice_idx],
            catch_exceptions=False,
        )
        print(run.output)
        model_res = tbmodels.Model.from_hdf5_file(out_file.name)
    model_reference = tbmodels.Model.from_hdf5_file(input_file).slice_orbitals(
        slice_idx=slice_idx
    )
    modify_reference_model_sparsity(model_reference)
    models_equal(model_res, model_reference)


def test_cli_slice_invalid(sample):
    """
    Check that passing an invalid index to the 'slice' command raises
    an error.
    """
    runner = CliRunner()
    input_file = sample("InAs_nosym.hdf5")
    with tempfile.NamedTemporaryFile() as out_file:
        with pytest.raises(IndexError):
            runner.invoke(

# Path: tbmodels/_cli.py
# @click.group()
# @click.version_option(version=tbmodels_version)
# def cli():
#     pass


# Path: tests/test_cli_slice.py
import tempfile
import pytest
import tbmodels
from click.testing import CliRunner
from tbmodels._cli import cli

                "slice",
                "-o",
                out_file.name,
                "-i",
                input_file,
            ]
            + cli_sparsity_arguments
            + cli_verbosity_argument
            + [str(x) for x in slice_idx],
            catch_exceptions=False,
        )
        print(run.output)
        model_res = tbmodels.Model.from_hdf5_file(out_file.name)
    model_reference = tbmodels.Model.from_hdf5_file(input_file).slice_orbitals(
        slice_idx=slice_idx
    )
    modify_reference_model_sparsity(model_reference)
    models_equal(model_res, model_reference)


def test_cli_slice_invalid(sample):
    """
    Check that passing an invalid index to the 'slice' command raises
    an error.
    """
    runner = CliRunner()
    input_file = sample("InAs_nosym.hdf5")
    with tempfile.NamedTemporaryFile() as out_file:
        with pytest.raises(IndexError):
            runner.invoke(

                cli,