Add tests for image layer, image plane, inventory, saved layout, commands, documentation, manifest, and packaging
- Implement tests for image layer functionality including alpha curve and depth layer behavior. - Create tests for image plane evaluation and modifier input handling. - Add tests to verify the saved asset inventory and its persistence. - Introduce tests for the documentation command to ensure correct project version deployment. - Validate the extension manifest structure and required permissions. - Develop tests for the packaging process, ensuring correct platform handling and dependency management. - Enhance image depth plane group functionality with new split threshold input and surface processing.
This commit is contained in:
42
tests/tools/test_docs.py
Normal file
42
tests/tools/test_docs.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from tests.support.paths import PROJECT_ROOT
|
||||
import importlib.util
|
||||
|
||||
|
||||
SCRIPT_PATH = PROJECT_ROOT / "tools" / "docs.py"
|
||||
SPEC = importlib.util.spec_from_file_location("docs_script", SCRIPT_PATH)
|
||||
docs = importlib.util.module_from_spec(SPEC)
|
||||
SPEC.loader.exec_module(docs)
|
||||
|
||||
|
||||
def test_documentation_command_deploys_project_version(monkeypatch):
|
||||
monkeypatch.setattr(docs, "project_version", lambda: "1.2.3")
|
||||
|
||||
assert docs.documentation_command() == [
|
||||
"mike",
|
||||
"deploy",
|
||||
"--update-aliases",
|
||||
"1.2.3",
|
||||
"latest",
|
||||
]
|
||||
|
||||
|
||||
def test_documentation_command_previews_current_source():
|
||||
assert docs.documentation_command(dev=True) == ["mkdocs", "serve"]
|
||||
|
||||
|
||||
def test_main_runs_from_project_root(monkeypatch):
|
||||
calls = []
|
||||
monkeypatch.setattr(
|
||||
docs.subprocess,
|
||||
"run",
|
||||
lambda *args, **kwargs: calls.append((args, kwargs)),
|
||||
)
|
||||
|
||||
docs.main(["-dev"])
|
||||
|
||||
assert calls == [
|
||||
(
|
||||
(["mkdocs", "serve"],),
|
||||
{"cwd": docs.PROJECT_ROOT, "check": True},
|
||||
)
|
||||
]
|
||||
Reference in New Issue
Block a user