summaryrefslogtreecommitdiff
path: root/tests/test_templite.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2013-10-27 18:34:06 -0400
committerNed Batchelder <ned@nedbatchelder.com>2013-10-27 18:34:06 -0400
commit8c275cd9b8817d0a817ebce853c111d11ceb86e9 (patch)
tree0ebb5403918adc866d60a0f00fe0901899a85cf1 /tests/test_templite.py
parent81f057339363478d626244f4cd1159cc4211a187 (diff)
downloadpython-coveragepy-git-8c275cd9b8817d0a817ebce853c111d11ceb86e9.tar.gz
More tests of Templite's sad-path behavior.
Diffstat (limited to 'tests/test_templite.py')
-rw-r--r--tests/test_templite.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_templite.py b/tests/test_templite.py
index e3918e4b..7326d241 100644
--- a/tests/test_templite.py
+++ b/tests/test_templite.py
@@ -39,6 +39,14 @@ class TempliteTest(CoverageTest):
# Variables use {{var}} syntax.
self.try_render("Hello, {{name}}!", {'name':'Ned'}, "Hello, Ned!")
+ def test_undefined_variables(self):
+ # Using undefined names is an error.
+ self.assertRaises(
+ Exception,
+ self.try_render,
+ "Hi, {{name}}!", {}, "xyz"
+ )
+
def test_pipes(self):
# Variables can be filtered with pipes.
data = {