6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-13 14:43:03 +00:00

Merge remote-tracking branch 'origin/master' into nightly

This commit is contained in:
Overhang.IO 2023-03-20 15:28:35 +00:00
commit c9cdf293ef
3 changed files with 3 additions and 2 deletions

View File

@ -0,0 +1 @@
- [Bugfix] Make sure that v0 plugin patches are applied in the same order as plugins are listed. (by @regisb)

View File

@ -86,7 +86,7 @@ class PluginsTests(PluginsTestCase):
plugins_v0.DictPlugin( plugins_v0.DictPlugin(
{"name": "plugin1", "patches": {"patch1": "Hello {{ ID }}"}} {"name": "plugin1", "patches": {"patch1": "Hello {{ ID }}"}}
) )
plugins.load("plugin1") plugins.load_all(["plugin1"])
patches = list(plugins.iter_patches("patch1")) patches = list(plugins.iter_patches("patch1"))
self.assertEqual(["Hello {{ ID }}"], patches) self.assertEqual(["Hello {{ ID }}"], patches)

View File

@ -146,7 +146,7 @@ class BasePlugin:
raise exceptions.TutorError( raise exceptions.TutorError(
f"Invalid patch '{patch_name}' in plugin {self.name}. Expected str, got {content.__class__}." f"Invalid patch '{patch_name}' in plugin {self.name}. Expected str, got {content.__class__}."
) )
hooks.Filters.ENV_PATCH(patch_name).add_item(content) hooks.Filters.ENV_PATCHES.add_item((patch_name, content))
def _load_tasks(self) -> None: def _load_tasks(self) -> None:
""" """