changeset 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
files examples/doctest.txt makeitso/python.py makeitso/python_package/setup.py
diffstat 3 files changed, 23 insertions(+), 3 deletions(-) [+]
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)
+
--- a/makeitso/python.py	Tue Jan 18 07:51:50 2011 -0800
+++ b/makeitso/python.py	Thu Jan 20 17:58:06 2011 -0800
@@ -60,7 +60,7 @@
 
     # get package name from project
     # XXX could have looser restrictions with transforms
-    assert variables['project'].isalpha(), 'Project name must be just letters'
+    assert variables['project'].isalnum(), 'Project name must be just letters, you gave %s' % variables['project']
     variables['package'] = variables['project'].lower()
 
     # dependencies
--- a/makeitso/python_package/setup.py	Tue Jan 18 07:51:50 2011 -0800
+++ b/makeitso/python_package/setup.py	Thu Jan 20 17:58:06 2011 -0800
@@ -9,7 +9,7 @@
 
 version = "0.0"
 
-depdendencies = {{dependencies}}
+dependencies = {{dependencies}}
 
 setup(name='{{project}}',
       version=version,