pronoun-o-matic/test_plugin.py
2022-06-04 22:30:29 +02:00

13 lines
433 B
Python

import logging
from plugins.log_plugin import LogPlugin
from plugin import load_plugins_for_config
def test_load_plugins_for_config() -> None:
config = [{"name": "log", "level": "DEBUG"}]
plugins = load_plugins_for_config(config)
# The only plugin loaded should be the log plugin
log_plugin = plugins[0]
assert isinstance(log_plugin, LogPlugin)
assert log_plugin.log_level == logging.getLevelName("DEBUG")