From 5140ed03593630c785ced79c65ed173b91ee80a2 Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Wed, 19 Jul 2023 18:32:41 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20unit=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_example_plugin.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_example_plugin.py b/tests/test_example_plugin.py index acfd2fe40..152b4e677 100644 --- a/tests/test_example_plugin.py +++ b/tests/test_example_plugin.py @@ -5,7 +5,7 @@ from tt.config import settings from tt.plugins.default_plugins.example_plugin import ExamplePlugin -from tt.plugins.plugin_manager import PluginManager +from tt.plugins.plugin_manager import BasePlugin, PluginManager @pytest.fixture(scope="session", autouse=True) @@ -29,6 +29,14 @@ async def test_plugin_manager(): plugin_manager = PluginManager() assert plugin_manager is not None + +@pytest.mark.asyncio +async def test_baseplugin(): + plugin = BasePlugin() + await plugin.start() + assert plugin is not None + + @pytest.mark.asyncio async def test_load_one_plugin(): plugin_module = importlib.import_module( @@ -80,4 +88,3 @@ async def test_plugin_notification(plugin, plugin_manager): send_notification = AsyncMock() await plugin.handle_message(f"{settings.bot_prefix}{settings.bot_command_help}") send_notification.assert_awaited_once -