comparison examples/doctest.txt @ 116:908e9a653668

fix a syntax error in the python template thanks to some friendly tests
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 20 Jan 2011 17:58:06 -0800
parents 7dbc3cdadffe
children de1ecefe301c
comparison
equal deleted inserted replaced
115:7dbc3cdadffe 116:908e9a653668
6 Boilerplate:: 6 Boilerplate::
7 7
8 >>> import makeitso 8 >>> import makeitso
9 >>> import os 9 >>> import os
10 >>> import shutil 10 >>> import shutil
11 >>> import sys
11 >>> import tempfile 12 >>> import tempfile
13 >>> from subprocess import call
12 >>> from StringIO import StringIO 14 >>> from StringIO import StringIO
13 15
14 Basic functionality:: 16 Basic functionality::
15 17
16 >>> example = os.path.join(here, 'example.txt') 18 >>> example = os.path.join(here, 'example.txt')
145 >>> missing = template.missing() 147 >>> missing = template.missing()
146 >>> sorted(missing) 148 >>> sorted(missing)
147 ['author', 'description', 'email', 'repo', 'url'] 149 ['author', 'description', 'email', 'repo', 'url']
148 >>> tempdir = tempfile.mkdtemp() 150 >>> tempdir = tempfile.mkdtemp()
149 >>> variables = dict([(i, i) for i in missing]) 151 >>> variables = dict([(i, i) for i in missing])
150 >>> template.substitute(variables, output=tempdir) 152 >>> projdir = os.path.join(tempdir, 'MyProject')
153 >>> template.substitute(variables, output=projdir)
154
155 Make sure this actually worked::
156
157 >>> cwd = os.getcwd()
158 >>> os.chdir(projdir)
159 >>> os.path.exists('setup.py')
160 True
161 >>> call([sys.executable, 'setup.py', 'egg_info'])
162 0
163 >>> call([sys.executable, 'setup.py', 'sdist'])
164 0
165 >>> os.path.exists('dist') and os.path.isdir('dist')
166 True
167 >>> len(os.listdir('dist')) > 0
168 True
169 >>> os.chdir(cwd)
151 >>> shutil.rmtree(tempdir) 170 >>> shutil.rmtree(tempdir)
171