3
from mako.ext.turbogears import TGPlugin
4
from util import flatten_result, result_lines
6
tl = TGPlugin(options=dict(directories=['./test_htdocs']), extension='html')
8
class TestTGPlugun(unittest.TestCase):
10
t = tl.load_template('/index.html')
11
assert result_lines(t.render()) == [
14
def test_subdir(self):
15
t = tl.load_template('/subdir/index.html')
16
assert result_lines(t.render()) == [
22
assert tl.load_template('/subdir/index.html').module_id == '_subdir_index_html'
24
def test_basic_dot(self):
25
t = tl.load_template('index')
26
assert result_lines(t.render()) == [
29
def test_subdir_dot(self):
30
t = tl.load_template('subdir.index')
31
assert result_lines(t.render()) == [
37
assert tl.load_template('subdir.index').module_id == '_subdir_index_html'
39
def test_string(self):
40
t = tl.load_template('foo', "hello world")
41
assert t.render() == "hello world"
43
if __name__ == '__main__':
b'\\ No newline at end of file'