pylorax.ltmpl: Add a test for missing quotes
It should raise an error if a quote is missing in the template.
(cherry picked from commit df3aeee802
)
This commit is contained in:
parent
389fd487da
commit
1d4f47e26f
4
tests/pylorax/templates/parse-missing-quote.tmpl
Normal file
4
tests/pylorax/templates/parse-missing-quote.tmpl
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<%page args="basearch"/>
|
||||||
|
|
||||||
|
# missing quote
|
||||||
|
replace @ROOT@ 'inst.stage2=hd:LABEL=foo isolinux.cfg
|
@ -58,6 +58,11 @@ class LoraxTemplateTestCase(unittest.TestCase):
|
|||||||
def setUpClass(self):
|
def setUpClass(self):
|
||||||
self.templates = LoraxTemplate(["./tests/pylorax/templates/"])
|
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):
|
def test_parse_template_x86_64(self):
|
||||||
"""Test LoraxTemplate.parse() with basearch set to x86_64"""
|
"""Test LoraxTemplate.parse() with basearch set to x86_64"""
|
||||||
commands = self.templates.parse("parse-test.tmpl", {"basearch": "x86_64"})
|
commands = self.templates.parse("parse-test.tmpl", {"basearch": "x86_64"})
|
||||||
|
Loading…
Reference in New Issue
Block a user