Skip to content

Commit

Permalink
✅ unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mraniki committed Jul 19, 2023
1 parent 9374374 commit 5140ed0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/test_example_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down Expand Up @@ -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

0 comments on commit 5140ed0

Please sign in to comment.