Commit 1f7195aa authored by Stefan H. Holek's avatar Stefan H. Holek

Raise SyntaxError when encountering invalid PythonScript headers.

parent 084c486f
......@@ -416,7 +416,7 @@ class PythonScript(Script, Historical, Cacheable):
k = k.strip().lower()
v = v.strip()
if not mdata.has_key(k):
SyntaxError, 'Unrecognized header line "%s"' % line
raise SyntaxError, 'Unrecognized header line "%s"' % line
if v == mdata[k]:
# Unchanged value
continue
......
......@@ -197,6 +197,9 @@ class TestPythonScriptNoAq(PythonScriptTestBase):
bound = f.__render_with_namespace__({'yes': 1, 'no': self.fail})
self.assertEqual(bound, 1)
def testNSBindInvalidHeader(self):
self.assertRaises(SyntaxError, self._filePS, 'ns_bind_invalid')
def testBooleanMap(self):
res = self._filePS('boolean_map')()
self.failUnless(res)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment