Remove mutable default from template-rendere
This commit is contained in:
@@ -3,7 +3,10 @@ Jinja2 rendering utils, used to generate new strategy and configurations.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def render_template(templatefile: str, arguments: dict = {}) -> str:
|
from typing import Dict
|
||||||
|
|
||||||
|
|
||||||
|
def render_template(templatefile: str, arguments: Dict) -> str:
|
||||||
|
|
||||||
from jinja2 import Environment, PackageLoader, select_autoescape
|
from jinja2 import Environment, PackageLoader, select_autoescape
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ def test_render_template_fallback():
|
|||||||
from jinja2.exceptions import TemplateNotFound
|
from jinja2.exceptions import TemplateNotFound
|
||||||
with pytest.raises(TemplateNotFound):
|
with pytest.raises(TemplateNotFound):
|
||||||
val = render_template(
|
val = render_template(
|
||||||
templatefile='subtemplates/indicators_does-not-exist.j2',)
|
templatefile='subtemplates/indicators_does-not-exist.j2',
|
||||||
|
arguments={},
|
||||||
|
)
|
||||||
|
|
||||||
val = render_template_with_fallback(
|
val = render_template_with_fallback(
|
||||||
templatefile='strategy_subtemplates/indicators_does-not-exist.j2',
|
templatefile='strategy_subtemplates/indicators_does-not-exist.j2',
|
||||||
|
|||||||
Reference in New Issue
Block a user