[Checkins] SVN: zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/ Moved corner case test to separate upgrading_distribute.txt file on Tarek's suggestion

Reinout van Rees reinout at vanrees.org
Tue Nov 10 08:49:52 EST 2009


Log message for revision 105558:
  Moved corner case test to separate upgrading_distribute.txt file on Tarek's suggestion

Changed:
  U   zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/easy_install.txt
  U   zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/tests.py
  A   zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/upgrading_distribute.txt

-=-
Modified: zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/easy_install.txt
===================================================================
--- zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/easy_install.txt	2009-11-10 09:46:05 UTC (rev 105557)
+++ zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/easy_install.txt	2009-11-10 13:49:51 UTC (rev 105558)
@@ -1328,40 +1328,3 @@
 
     >>> zc.buildout.easy_install.install_from_cache(False)
     True
-
-Installing setuptools/distribute
---------------------------------
-
-Setuptools (0.6something) is packaged as an ``.egg``.  So when installing it,
-the egg is downloaded and used.  Distribute is packaged as a tarball, which
-makes an easy_install call necessary.  In older versions of buildout, the
-``_call_easy_install()`` method would call ``_get_dist()`` to get hold of the
-setuptools path for calling easy_install.  When an updated "distribute" was
-found, this would try an install again, leading to an infinite recursion.
-
-The solution is to just use the setuptools location found at import time, like
-happens with the buildout and setuptools location that is inserted in scripts'
-paths.
-
-We test this corner case by patching the ``_get_dist()`` call:
-
-    >>> def mock_get_dist(requirement, ws, always_unzip):
-    ...     raise RuntimeError("We should not get called")
-
-When installing setuptools itself, we expect the "Getting dist" message not to
-be printed.  We call ``_call_easy_install()`` directly and get an error
-because of a non-existing tarball, but that's the OK for this corner case
-test: we only want to test that ``_get_dist()`` isn't getting called:
-
-    >>> installer = zc.buildout.easy_install.Installer(
-    ...     dest=dest,
-    ...     links=[link_server],
-    ...     index=link_server+'index/',
-    ...     executable=sys.executable,
-    ...     always_unzip=True)
-    >>> installer._get_dist = mock_get_dist
-    >>> installer._call_easy_install('setuptools', None, dest, 
-    ...                              'nonexisting.tgz')
-    Traceback (most recent call last):
-    ...
-    UserError: Couldn't install: nonexisting.tgz

Modified: zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/tests.py
===================================================================
--- zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/tests.py	2009-11-10 09:46:05 UTC (rev 105557)
+++ zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/tests.py	2009-11-10 13:49:51 UTC (rev 105558)
@@ -2922,7 +2922,7 @@
 
         doctest.DocFileSuite(
             'easy_install.txt', 'downloadcache.txt', 'dependencylinks.txt',
-            'allowhosts.txt', 'unzip.txt',
+            'allowhosts.txt', 'unzip.txt', 'upgrading_distribute.txt',
             setUp=easy_install_SetUp,
             tearDown=zc.buildout.testing.buildoutTearDown,
             checker=renormalizing.RENormalizing([

Added: zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/upgrading_distribute.txt
===================================================================
--- zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/upgrading_distribute.txt	                        (rev 0)
+++ zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/upgrading_distribute.txt	2009-11-10 13:49:51 UTC (rev 105558)
@@ -0,0 +1,42 @@
+Installing setuptools/distribute
+--------------------------------
+
+Some initial test setup:
+
+    >>> import sys
+    >>> import zc.buildout.easy_install
+    >>> dest = tmpdir('sample-install')
+
+Setuptools (0.6something) is packaged as an ``.egg``.  So when installing it,
+the egg is downloaded and used.  Distribute is packaged as a tarball, which
+makes an easy_install call necessary.  In older versions of buildout, the
+``_call_easy_install()`` method would call ``_get_dist()`` to get hold of the
+setuptools path for calling easy_install.  When an updated "distribute" was
+found, this would try an install again, leading to an infinite recursion.
+
+The solution is to just use the setuptools location found at import time, like
+happens with the buildout and setuptools location that is inserted in scripts'
+paths.
+
+We test this corner case by patching the ``_get_dist()`` call:
+
+    >>> def mock_get_dist(requirement, ws, always_unzip):
+    ...     raise RuntimeError("We should not get called")
+
+When installing setuptools itself, we expect the "Getting dist" message not to
+be printed.  We call ``_call_easy_install()`` directly and get an error
+because of a non-existing tarball, but that's the OK for this corner case
+test: we only want to test that ``_get_dist()`` isn't getting called:
+
+    >>> installer = zc.buildout.easy_install.Installer(
+    ...     dest=dest,
+    ...     links=[link_server],
+    ...     index=link_server+'index/',
+    ...     executable=sys.executable,
+    ...     always_unzip=True)
+    >>> installer._get_dist = mock_get_dist
+    >>> installer._call_easy_install('setuptools', None, dest, 
+    ...                              'nonexisting.tgz')
+    Traceback (most recent call last):
+    ...
+    UserError: Couldn't install: nonexisting.tgz


Property changes on: zc.buildout/branches/reinout_distribute_upgrade_check/src/zc/buildout/upgrading_distribute.txt
___________________________________________________________________
Added: svn:eol-style
   + native



More information about the checkins mailing list