aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_lookup.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-05-31 16:11:33 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-05-31 16:11:33 -0400
commit3ef596c2f5217993d92e1cded3efc44d249eb183 (patch)
treec4fd14958bd5a3bc6367e9bd58f1124fa1284fbb /test/test_lookup.py
parente23877edcbddde78ed56ca8e824520b8ab6af0b5 (diff)
downloadexternal_python_mako-3ef596c2f5217993d92e1cded3efc44d249eb183.tar.gz
external_python_mako-3ef596c2f5217993d92e1cded3efc44d249eb183.tar.bz2
external_python_mako-3ef596c2f5217993d92e1cded3efc44d249eb183.zip
- Added conditional to RichTraceback
such that if no traceback is passed and sys.exc_info() has been reset, the formatter just returns blank for the "traceback" portion. [ticket:135] - some long line cleanup
Diffstat (limited to 'test/test_lookup.py')
-rw-r--r--test/test_lookup.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/test/test_lookup.py b/test/test_lookup.py
index 5e6cb24..c62efd5 100644
--- a/test/test_lookup.py
+++ b/test/test_lookup.py
@@ -20,7 +20,8 @@ class LookupTest(unittest.TestCase):
]
- assert tl.get_template('/subdir/index.html').module_id == '_subdir_index_html'
+ assert tl.get_template('/subdir/index.html').module_id \
+ == '_subdir_index_html'
def test_updir(self):
t = tl.get_template('/subdir/foo/../bar/../index.html')
@@ -31,7 +32,8 @@ class LookupTest(unittest.TestCase):
]
def test_directory_lookup(self):
- """test that hitting an existent directory still raises LookupError."""
+ """test that hitting an existent directory still raises
+ LookupError."""
self.assertRaises(exceptions.TopLevelLookupException,
tl.get_template, "/subdir"
@@ -43,14 +45,18 @@ class LookupTest(unittest.TestCase):
t.render()
assert False
except exceptions.TemplateLookupException, e:
- assert str(e) == "Template 'memory:%s' has no TemplateLookup associated" % hex(id(t))
+ assert str(e) == \
+ "Template 'memory:%s' has no TemplateLookup associated" % \
+ hex(id(t))
def test_uri_adjust(self):
tl = lookup.TemplateLookup(directories=['/foo/bar'])
- assert tl.filename_to_uri('/foo/bar/etc/lala/index.html') == '/etc/lala/index.html'
+ assert tl.filename_to_uri('/foo/bar/etc/lala/index.html') == \
+ '/etc/lala/index.html'
tl = lookup.TemplateLookup(directories=['./foo/bar'])
- assert tl.filename_to_uri('./foo/bar/etc/index.html') == '/etc/index.html'
+ assert tl.filename_to_uri('./foo/bar/etc/index.html') == \
+ '/etc/index.html'
def test_uri_cache(self):
"""test that the _uri_cache dictionary is available"""