6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-11-11 07:41:02 +00:00
tutor/tests/test_plugins.py
Régis Behmo 487ca89885 chore: add missing test fixture and changelog entry
We somehow forgot to include these files in a previous commit...
2024-02-08 11:21:30 +01:00

17 lines
539 B
Python

from __future__ import annotations
from tests.helpers import PluginsTestCase
from tutor import hooks, plugins
class PluginsTests(PluginsTestCase):
def test_env_patches_updated_on_new_plugin(self) -> None:
self.assertEqual([], list(plugins.iter_patches("mypatch")))
hooks.Filters.ENV_PATCHES.add_item(("mypatch", "hello!"))
# env patches cache should be cleared on new plugin
hooks.Actions.PLUGIN_LOADED.do("dummyplugin")
self.assertEqual(["hello!"], list(plugins.iter_patches("mypatch")))