[Checkins] SVN: grokproject/trunk/tests_ Test cleanup. Tests pass now on python 2.6. (That's because we use grok 1.1a2 and 1.1rc1 as "test content").

Jan-Jaap Driessen jdriessen at thehealthagency.com
Mon Apr 19 07:46:58 EDT 2010


Log message for revision 111086:
  Test cleanup. Tests pass now on python 2.6. (That's because we use grok 1.1a2 and 1.1rc1 as "test content").

Changed:
  U   grokproject/trunk/tests_alternative_release_url.txt
  U   grokproject/trunk/tests_paste.txt

-=-
Modified: grokproject/trunk/tests_alternative_release_url.txt
===================================================================
--- grokproject/trunk/tests_alternative_release_url.txt	2010-04-19 11:45:35 UTC (rev 111085)
+++ grokproject/trunk/tests_alternative_release_url.txt	2010-04-19 11:46:57 UTC (rev 111086)
@@ -61,28 +61,6 @@
     static
     tests.py
 
-Let's see if the information in our fake release URL was correctly propagated.
-
-    >>> cat(package_dir, 'buildout.cfg')
-    [buildout]
-    ...
-    extends = 
-    # belong together.
-    # It was downloaded from file://.../fake_release/grok-0.555.cfg
-    # when this project was created.
-    <BLANKLINE>
-    [versions]
-    grok = 0.555
-    <BLANKLINE>
-
-    >>> cat(package_dir, 'buildout.cfg')
-    [buildout]
-    ...
-    [eggbasket]
-    recipe = z3c.recipe.eggbasket
-    eggs = grok
-    url = file:///.../grok-eggs-0.555.tgz...
-
 Cleanup:
 
     >>> rmdir(package_dir)

Modified: grokproject/trunk/tests_paste.txt
===================================================================
--- grokproject/trunk/tests_paste.txt	2010-04-19 11:45:35 UTC (rev 111085)
+++ grokproject/trunk/tests_paste.txt	2010-04-19 11:46:57 UTC (rev 111086)
@@ -20,12 +20,22 @@
 
 Then use paster. Eggs are placed in our freshly created eggs directory::
 
-    >>> paster = current_dir + '/bin/paster'
-    >>> params = ['create','-t', 'grok', 'GrokExample', 'user=a', 'passwd=a']
-    >>> sh([paster] + params + ['eggs_dir=%s' % eggsdir, '--no-interactive'])
-    ['/.../bin/paster', 'create', '-t', 'grok', 'GrokExample', 
-     'user=a', 'passwd=a', ...
-    ...
+    >>> # Use a specific grok version, because 'current' will change at some
+    >>> # point in the future.
+    >>> executable = [current_dir + '/bin/grokproject']
+    >>> opts = ['--user=a', '--passwd=a', '--eggs-dir=' + eggsdir]
+    >>> grokversion = ['--grokversion=1.1rc1']
+    >>> sh(executable + opts + grokversion + ['GrokExample'])
+    ['...grokproject', '--user=a', '--passwd=a', '--eggs-dir=...grokexample-eggs',
+    '--grokversion=1.1rc1', 'GrokExample']
+    Creating directory ./GrokExample
+    Downloading zc.buildout...
+    Invoking zc.buildout...
+    *************** PICKED VERSIONS ****************
+    [versions]
+    <BLANKLINE>
+    *************** /PICKED VERSIONS ***************
+    <BLANKLINE>
 
 Let's check the contents::
 
@@ -95,20 +105,6 @@
     site-definition ...GrokExample/parts/etc/site.zcml
     ...
 
-We can influence the version of grok to be installed by using the
-``grokversion`` parameter. 
-
-    >>> params += ['grokversion=1.1rc1']
-    >>> sh([paster] + params + ['eggs_dir=%s' % eggsdir, '--no-interactive'])
-    ['/.../bin/paster', 'create', '-t', 'grok', 'GrokExample', 'grokversion=1.1rc1',
-    ...
-
-    >>> cat('buildout_cfg')
-    [buildout]
-    ...
-    extends = http://grok.zope.org/releaseinfo/grok-1.1rc1.cfg
-    ...
-
 The password given is stored SHA1 encoded::
 
     >>> site_zcml_in = os.path.join(package_dir, 'etc', 
@@ -240,19 +236,18 @@
     >>> cd(package_dir)
     >>> cmd = os.path.join(bin_dir, 'buildout')
     >>> output = read_sh(cmd)
-    >>> print output # doctest: +REPORT_UDIFF
+    >>> print output
     Develop: ...
-    Updating eggbasket.
     Updating app.
+    Updating site_zcml.
+    Updating zope_conf.
+    Updating debug_ini.
+    Updating deploy_ini.
     Updating i18n.
     i18n: setting up i18n tools
+    Updating mkdirs.
     Updating test.
-    Updating site_zcml.
-    Updating zope_conf.
-    Updating mkdirs.
     Updating zpasswd.
-    Updating deploy_ini.
-    Updating debug_ini.
     Updating data.
     Updating log.
     *************** PICKED VERSIONS ****************
@@ -261,27 +256,36 @@
     *************** /PICKED VERSIONS ***************
     <BLANKLINE>
 
-Using the generated `bootstrap` script
---------------------------------------
+We can influence the version of grok to be installed by using the
+``grokversion`` parameter. 
 
-Generated grokprojects come with their own `bootstrap.py` script, that
-makes it easier to distribute projects. As a normal Python module it
-has to be called with a Python interpreter::
-
-    >>> import sys
-    >>> cmd_arg = os.path.join(package_dir, 'bootstrap.py')
-    >>> output = "OUTPUT:\n" + read_sh([sys.executable, cmd_arg])
-    >>> print output
-    OUTPUT:
+    >>> cd(tempdir)
+    >>> package_dir = os.path.join(tempdir, 'GrokExample2')
+    >>> grokversion = ['--grokversion=1.1a2']
+    >>> # WARNING: We know that running the buildout of grok 1.1a2 has a 
+    >>> # buildout failure. That's OK for this test, as we want to show 
+    >>> # that we can point to a different version.
+    >>> sh(executable + opts + grokversion + ['GrokExample2'])
+    ['...grokproject', '--user=a', '--passwd=a', '--eggs-dir=...grokexample-eggs',
+    '--grokversion=1.1a2', 'GrokExample2']
+    Creating directory ./GrokExample2
+    Downloading zc.buildout...
     ...
-    Installing 'z3c.recipe.eggbasket'.
+    Invoking zc.buildout...
+    *************** PICKED VERSIONS ****************
+    [versions]
     ...
-    Now you can run 'bin/buildout'
+    *************** /PICKED VERSIONS ***************
 
+    >>> print open(os.path.join(package_dir, 'buildout.cfg')).read()
+    [buildout]
+    extends = http://grok.zope.org/releaseinfo/grok-1.1a2.cfg
+    ...
 
 Clean up::
 
     >>> cd(tempdir)
     >>> rmdir('GrokExample')
+    >>> rmdir('GrokExample2')
     >>> maybe_rmdir(eggsdir)
 



More information about the checkins mailing list