comparison examples/doctest.txt @ 115:7dbc3cdadffe

add a test for the python-package template
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 18 Jan 2011 07:51:50 -0800
parents b54898f7d8a9
children 908e9a653668
comparison
equal deleted inserted replaced
114:b8d5d2041fe0 115:7dbc3cdadffe
134 >>> uritemplate = makeitso.URITemplate(example, interactive=False) 134 >>> uritemplate = makeitso.URITemplate(example, interactive=False)
135 >>> uritemplate.substitute(dict(name='bar'), buffer) 135 >>> uritemplate.substitute(dict(name='bar'), buffer)
136 >>> ('%o' % os.stat(buffer).st_mode).endswith('755') 136 >>> ('%o' % os.stat(buffer).st_mode).endswith('755')
137 True 137 True
138 >>> os.remove(buffer) 138 >>> os.remove(buffer)
139
140 Test python package template using the entry point::
141
142 >>> 'python-package' in makeitso.get_entry_points()
143 True
144 >>> template = makeitso.PolyTemplate(['python-package'], interactive=False)
145 >>> missing = template.missing()
146 >>> sorted(missing)
147 ['author', 'description', 'email', 'repo', 'url']
148 >>> tempdir = tempfile.mkdtemp()
149 >>> variables = dict([(i, i) for i in missing])
150 >>> template.substitute(variables, output=tempdir)
151 >>> shutil.rmtree(tempdir)