changeset 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 b8d5d2041fe0
children 908e9a653668
files examples/doctest.txt makeitso/python.py
diffstat 2 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/examples/doctest.txt	Mon Jan 17 14:38:42 2011 -0800
+++ b/examples/doctest.txt	Tue Jan 18 07:51:50 2011 -0800
@@ -136,3 +136,16 @@
     >>> ('%o' % os.stat(buffer).st_mode).endswith('755')
     True
     >>> os.remove(buffer)
+
+Test python package template using the entry point::
+
+    >>> 'python-package' in makeitso.get_entry_points()
+    True
+    >>> template = makeitso.PolyTemplate(['python-package'], interactive=False)
+    >>> missing = template.missing()
+    >>> sorted(missing)
+    ['author', 'description', 'email', 'repo', 'url']
+    >>> tempdir = tempfile.mkdtemp()
+    >>> variables = dict([(i, i) for i in missing])
+    >>> template.substitute(variables, output=tempdir)
+    >>> shutil.rmtree(tempdir)
--- a/makeitso/python.py	Mon Jan 17 14:38:42 2011 -0800
+++ b/makeitso/python.py	Tue Jan 18 07:51:50 2011 -0800
@@ -31,6 +31,8 @@
   name = 'python-package'
   templates = ['python_package']
   vars = [Variable('description'),
+          Variable('author', 'author of the package'),
+          Variable('email', "author's email"),
           Variable('url'),
           Variable('repo', 'project repository'),
           ]