MCPcopy
hub / github.com/lektor/lektor / theme_project_tmpdir

Function theme_project_tmpdir

tests/test_themes.py:16–26  ·  view source on GitHub ↗

Copy themes-project to a temp dir, and copy demo-project content to it.

(tmpdir)

Source from the content-addressed store, hash-verified

14
15@pytest.fixture(scope="function")
16def theme_project_tmpdir(tmpdir):
17 """Copy themes-project to a temp dir, and copy demo-project content to it."""
18 themes_dir = os.path.join(os.path.dirname(__file__), "themes-project")
19 content_dir = os.path.join(os.path.dirname(__file__), "demo-project", "content")
20
21 temp_dir = tmpdir.mkdir("temp").join("themes-project")
22
23 shutil.copytree(themes_dir, str(temp_dir))
24 shutil.copytree(content_dir, str(temp_dir.join("content")))
25
26 return temp_dir
27
28
29@pytest.fixture(scope="function")

Callers

nothing calls this directly

Calls 1

mkdirMethod · 0.80

Tested by

no test coverage detected