comparison examples/doctest.txt @ 91:672d2d3ee322

document a bit and add a test for an include example
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 10 Jan 2011 21:42:32 -0800
parents 26b9c3bba04e
children e74baa8e6df4
comparison
equal deleted inserted replaced
90:26b9c3bba04e 91:672d2d3ee322
33 >>> buffer = tempfile.mktemp() 33 >>> buffer = tempfile.mktemp()
34 >>> template = makeitso.PolyTemplate([example], interactive=False) 34 >>> template = makeitso.PolyTemplate([example], interactive=False)
35 >>> template.substitute(dict(name='fleem'), buffer) 35 >>> template.substitute(dict(name='fleem'), buffer)
36 >>> file(buffer).read().strip() 36 >>> file(buffer).read().strip()
37 'Hello fleem' 37 'Hello fleem'
38 >>> os.remove(buffer)
39
40 Including a file::
41
42 >>> include_example = os.path.join(here, 'include-example.txt')
43 >>> buffer = tempfile.mktemp()
44 >>> template = makeitso.PolyTemplate([include_example], interactive=False)
45 >>> template.substitute({}, buffer)
38 >>> os.remove(buffer) 46 >>> os.remove(buffer)
39 47
40 Directory case:: 48 Directory case::
41 49
42 >>> exampledir = os.path.join(here, 'directory-example') 50 >>> exampledir = os.path.join(here, 'directory-example')