mirror of
https://github.com/copier-org/copier.git
synced 2025-05-31 23:25:15 +00:00
20 lines
590 B
Python
20 lines
590 B
Python
from pathlib import Path
|
|
|
|
from copier import tools
|
|
from copier.config.factory import EnvOps
|
|
|
|
from .helpers import DATA, PROJECT_TEMPLATE
|
|
|
|
|
|
def test_render(dst):
|
|
envops = EnvOps().dict()
|
|
render = tools.get_jinja_renderer(PROJECT_TEMPLATE, DATA, envops=envops)
|
|
|
|
assert render.string("/hello/[[ what ]]/") == "/hello/world/"
|
|
assert render.string("/hello/world/") == "/hello/world/"
|
|
|
|
sourcepath = PROJECT_TEMPLATE / "pyproject.toml.tmpl"
|
|
result = render(sourcepath)
|
|
expected = Path("./tests/reference_files/pyproject.toml").read_text()
|
|
assert result == expected
|