def test_include_invalid_path(self): j2_loader = templates.J2SwiftLoader(self._setup_swift(), 'bar') template = jinja2.Environment(loader=j2_loader).from_string(r''' Included this: {% include '../foo.yaml' %} ''') self.assertRaises(jinja2.exceptions.TemplateNotFound, template.render)
def test_include_search_path(self): j2_loader = templates.J2SwiftLoader(self._setup_swift(), None, 'bar') template = jinja2.Environment(loader=j2_loader).from_string(r''' Included this: {% include 'foo.yaml' %} ''') self.assertEqual( template.render(), ''' Included this: I am foo ''')