def test_get_verbosity_subcommand() -> None:
    """Test if the verbosity level and subcommand are correctly parsed."""
    argv = ["anomalib", "fit", "-h"]
    with patch.object(sys, "argv", argv):
        assert get_verbosity_subcommand() == {"help": True, "verbosity": 0, "subcommand": "fit"}

    argv = ["anomalib", "fit", "-h", "-v"]
    with patch.object(sys, "argv", argv):
        assert get_verbosity_subcommand() == {"help": True, "verbosity": 1, "subcommand": "fit"}

    argv = ["anomalib", "fit", "-h", "-vv"]
    with patch.object(sys, "argv", argv):
        assert get_verbosity_subcommand() == {"help": True, "verbosity": 2, "subcommand": "fit"}

    argv = ["anomalib", "-h"]
    with patch.object(sys, "argv", argv):
        assert get_verbosity_subcommand() == {"help": True, "verbosity": 2, "subcommand": None}
Test if the verbosity level and subcommand are correctly parsed.
tests/unit/cli/test_help_formatter.py