Mercurial > hg > MakeItSo
diff examples/doctest.txt @ 35:7e47ff4b0cd3
started writing tests; what a surprise, everything is broken ;)
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 01 Jan 2011 21:58:34 -0800 |
parents | |
children | 0cba953a03ca |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/doctest.txt Sat Jan 01 21:58:34 2011 -0800 @@ -0,0 +1,26 @@ +MakeItSo! +========= + +Boilerplate: + + >>> import makeitso + >>> import os + >>> from StringIO import StringIO + >>> example = os.path.join(here, 'example.txt') + +Basic functionality: + + >>> template = makeitso.PolyTemplate([example], interactive=False) + >>> template.missing() + set(['name']) + >>> template.substitute(name='foo') + None + +Substitute to a buffer: + + >>> buffer = StringIO() + >>> template = makeitso.PolyTemplate([example], output=buffer, interactive=False) + >>> template.substitute(name='bar') + None + >>> buffer.getvalue() +