def test_template_dict(self):
     assert (template({
         "a": "{{ avar }}",
         "b": "{{ bvar }}"
     }, {
         "avar": "a",
         "bvar": "b"
     }) == {
         "a": "a",
         "b": "b"
     })
Esempio n. 2
0
    def test_template_loader_default_path(self, jinja_loader):
        template('string', {})

        jinja_loader.assert_called_with(DEFAULT_TEMPLATES_PATH)
Esempio n. 3
0
 def test_template_nested_list(self):
     assert(
         template([["{{ avar }}"], "{{ bvar }}"],
                  {"avar": "a", "bvar": "b"})
         == [["a"], "b"]
     )
Esempio n. 4
0
 def test_template_string(self):
     assert template("{{ var }} string", {"var": "a"}) == "a string"