diff --git a/tests/pylorax/templates/parse-missing-quote.tmpl b/tests/pylorax/templates/parse-missing-quote.tmpl new file mode 100644 index 00000000..ebcb343f --- /dev/null +++ b/tests/pylorax/templates/parse-missing-quote.tmpl @@ -0,0 +1,4 @@ +<%page args="basearch"/> + +# missing quote +replace @ROOT@ 'inst.stage2=hd:LABEL=foo isolinux.cfg diff --git a/tests/pylorax/test_ltmpl.py b/tests/pylorax/test_ltmpl.py index 91704039..7af91fdd 100644 --- a/tests/pylorax/test_ltmpl.py +++ b/tests/pylorax/test_ltmpl.py @@ -58,6 +58,11 @@ class LoraxTemplateTestCase(unittest.TestCase): def setUpClass(self): self.templates = LoraxTemplate(["./tests/pylorax/templates/"]) + def test_parse_missing_quote(self): + """Test parsing a template with missing quote""" + with self.assertRaises(Exception): + self.templates.parse("parse-missing-quote.tmpl", {"basearch": "x86_64"}) + def test_parse_template_x86_64(self): """Test LoraxTemplate.parse() with basearch set to x86_64""" commands = self.templates.parse("parse-test.tmpl", {"basearch": "x86_64"})