# Path: porcupine/pluginloader.py
# class Status(enum.Enum):
# class PluginInfo:
#     LOADING = enum.auto()
#     ACTIVE = enum.auto()
#     DISABLED_BY_SETTINGS = enum.auto()
#     DISABLED_ON_COMMAND_LINE = enum.auto()
#     IMPORT_FAILED = enum.auto()
#     SETUP_FAILED = enum.auto()
#     CIRCULAR_DEPENDENCY_ERROR = enum.auto()
# def _run_setup_argument_parser_function(info: PluginInfo, parser: argparse.ArgumentParser) -> None:
# def _import_plugin(info: PluginInfo) -> None:
# def _run_setup_and_set_status(info: PluginInfo) -> None:
# def _did_plugin_come_with_porcupine(finder: object) -> bool:
# def import_plugins(disabled_on_command_line: list[str]) -> None:
# def run_setup_argument_parser_functions(parser: argparse.ArgumentParser) -> None:
# def run_setup_functions(shuffle: bool) -> None:
# def can_setup_while_running(info: PluginInfo) -> bool:
# def setup_while_running(info: PluginInfo) -> None:


from porcupine import pluginloader


def test_all_plugins_loaded_successfully():
    # If loading failed, errors were logged and printed to stderr
    assert pluginloader.plugin_infos, "if this fails, it means no plugins got loaded"
    for info in pluginloader.plugin_infos:
        # it's ok if you don't have tkdnd installed, doesn't get installed with pip
        if info.name != "drop_to_open":

# Path: porcupine/pluginloader.py
# class Status(enum.Enum):
# class PluginInfo:
#     LOADING = enum.auto()
#     ACTIVE = enum.auto()
#     DISABLED_BY_SETTINGS = enum.auto()
#     DISABLED_ON_COMMAND_LINE = enum.auto()
#     IMPORT_FAILED = enum.auto()
#     SETUP_FAILED = enum.auto()
#     CIRCULAR_DEPENDENCY_ERROR = enum.auto()
# def _run_setup_argument_parser_function(info: PluginInfo, parser: argparse.ArgumentParser) -> None:
# def _import_plugin(info: PluginInfo) -> None:
# def _run_setup_and_set_status(info: PluginInfo) -> None:
# def _did_plugin_come_with_porcupine(finder: object) -> bool:
# def import_plugins(disabled_on_command_line: list[str]) -> None:
# def run_setup_argument_parser_functions(parser: argparse.ArgumentParser) -> None:
# def run_setup_functions(shuffle: bool) -> None:
# def can_setup_while_running(info: PluginInfo) -> bool:
# def setup_while_running(info: PluginInfo) -> None:


# Path: tests/test_pluginloader.py
from porcupine import pluginloader



def test_all_plugins_loaded_successfully():
    # If loading failed, errors were logged and printed to stderr
    assert pluginloader.plugin_infos, "if this fails, it means no plugins got loaded"
    for info in pluginloader.plugin_infos:
        # it's ok if you don't have tkdnd installed, doesn't get installed with pip
        if info.name != "drop_to_open":

            assert info.status == pluginloader.Status.ACTIVE