myTestFreqAI/tests/util/test_rendering_utils.py
Ubuntu 17199e9a44
Some checks failed
Pre-commit auto-update / auto-update (push) Has been cancelled
first add
2025-04-21 21:11:51 +08:00

21 lines
621 B
Python

import pytest
from freqtrade.util import render_template, render_template_with_fallback
def test_render_template_fallback():
from jinja2.exceptions import TemplateNotFound
with pytest.raises(TemplateNotFound):
val = render_template(
templatefile="subtemplates/indicators_does-not-exist.j2",
arguments={},
)
val = render_template_with_fallback(
templatefile="strategy_subtemplates/indicators_does-not-exist.j2",
templatefallbackfile="strategy_subtemplates/indicators_minimal.j2",
)
assert isinstance(val, str)
assert "if self.dp" in val