Skip to content

Commit

Permalink
Pynorms
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidNew-NOAA committed Jun 14, 2024
1 parent ae7be75 commit a26ca2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/wxflow/jinja.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import os
import sys
from functools import reduce
from pathlib import Path
from typing import Dict, List, Union

import jinja2
from markupsafe import Markup
from functools import reduce

from .timetools import (add_to_datetime, strftime, to_fv3time, to_isotime,
to_julian, to_timedelta, to_YMD, to_YMDH)
Expand Down
6 changes: 4 additions & 2 deletions tests/test_jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ def test_render_stream():
assert j.render == f"Hello Jane! How are you? It is: {to_isotime(current_date)}"

tmpl_dict = {"{{ name }}": "Jane", "{{ greeting }}": "How are you?", "{{ current_date | to_isotime }}": to_isotime(current_date)}
env = Jinja.get_set_env(jinja2.BaseLoader())
j = Jinja(j2tmpl, data, allow_missing=False)
loader = jinja2.BaseLoader()
env = j.get_set_env(loader)
assert env.filters['replace_tmpl'](j2tmpl, tmpl_dict) == f"Hello Jane! How are you? It is: {to_isotime(current_date)}"


def test_render_file(tmp_path, create_template):

Expand Down

0 comments on commit a26ca2d

Please sign in to comment.