Mercurial > hg > MakeItSo
diff 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 |
line wrap: on
line diff
--- a/examples/doctest.txt Tue Jan 18 07:51:50 2011 -0800 +++ b/examples/doctest.txt Thu Jan 20 17:58:06 2011 -0800 @@ -8,7 +8,9 @@ >>> import makeitso >>> import os >>> import shutil + >>> import sys >>> import tempfile + >>> from subprocess import call >>> from StringIO import StringIO Basic functionality:: @@ -147,5 +149,23 @@ ['author', 'description', 'email', 'repo', 'url'] >>> tempdir = tempfile.mkdtemp() >>> variables = dict([(i, i) for i in missing]) - >>> template.substitute(variables, output=tempdir) + >>> projdir = os.path.join(tempdir, 'MyProject') + >>> template.substitute(variables, output=projdir) + +Make sure this actually worked:: + + >>> cwd = os.getcwd() + >>> os.chdir(projdir) + >>> os.path.exists('setup.py') + True + >>> call([sys.executable, 'setup.py', 'egg_info']) + 0 + >>> call([sys.executable, 'setup.py', 'sdist']) + 0 + >>> os.path.exists('dist') and os.path.isdir('dist') + True + >>> len(os.listdir('dist')) > 0 + True + >>> os.chdir(cwd) >>> shutil.rmtree(tempdir) +