Mercurial > hg > MakeItSo
diff examples/doctest.txt @ 67:a0f7bfa98755
API templates now hobble along on their own two feet
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 07 Jan 2011 10:58:28 -0800 |
parents | 0152741621c1 |
children | 3571417ef92e |
line wrap: on
line diff
--- a/examples/doctest.txt Fri Jan 07 10:53:12 2011 -0800 +++ b/examples/doctest.txt Fri Jan 07 10:58:28 2011 -0800 @@ -85,4 +85,9 @@ ... name = 'foo' ... templates = ['example.txt'] ... vars = [Variable(name='name', default='bar')] - >>> apitemplate = MyTemplate() + >>> buffer = tempfile.mktemp() + >>> apitemplate = MyTemplate(output=buffer) + >>> apitemplate.substitute() + >>> file(buffer).read().strip() + 'Hello bar' + >>> os.remove(buffer)