refactor: finalize scheduler and plugin integration

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
This commit is contained in:
squidfunk
2026-09-01 18:36:02 +02:00
parent 1e1fc7975b
commit 3c779b98b8
17 changed files with 262 additions and 94 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+31 -1
View File
@@ -171,6 +171,18 @@ class TestPluginShimming:
config = self._parse_yaml(tmp_path, plugins={"glightbox": {}})
assert GlightboxExtension.name in config["markdown_extensions"]
@pytest.mark.parametrize(
"entry", ["material/meta", {"material/meta": None}]
)
def test_material_meta_presence_enables_defaults(
self, tmp_path: Path, entry: object
) -> None:
config = self._parse_yaml(tmp_path, plugins=[entry])
assert config["plugins"]["meta"]["config"] == {
"enabled": True,
"meta_file": ".meta.yml",
}
def test_material_meta_plugin_is_normalized(self, tmp_path: Path) -> None:
config = self._parse_yaml(
tmp_path,
@@ -183,6 +195,25 @@ class TestPluginShimming:
}
assert config["plugins_hash"] == cfg_module._hash(config["plugins"])
@pytest.mark.parametrize(
"name",
[
"material/meta",
"redirects",
"minify",
"literate-nav",
"awesome-nav",
],
)
def test_native_plugin_configuration_must_be_a_mapping(
self, tmp_path: Path, name: str
) -> None:
with pytest.raises(
cfg_module.ConfigurationError,
match=rf"{name} configuration must be a mapping",
):
self._parse_yaml(tmp_path, plugins={name: []})
def test_redirects_plugin_is_normalized(self, tmp_path: Path) -> None:
config = self._parse_yaml(
tmp_path,
@@ -292,7 +323,6 @@ class TestPluginShimming:
@pytest.mark.parametrize(
("plugin", "message"),
[
([], "configuration must be a mapping"),
({"unknown": True}, "unknown awesome-nav option"),
({"filename": 42}, "filename must be a string"),
({"filename": ""}, "filename must not be empty"),