[Checkins] SVN: zc.buildout/branches/regebro-python3/src/zc/buildout/ dependencylinks.txt and upgrading_distribute.txt passes.

Lennart Regebro regebro at gmail.com
Wed Nov 24 08:16:36 EST 2010


Log message for revision 118555:
  dependencylinks.txt and upgrading_distribute.txt passes.
  

Changed:
  U   zc.buildout/branches/regebro-python3/src/zc/buildout/dependencylinks.txt
  U   zc.buildout/branches/regebro-python3/src/zc/buildout/download.py
  U   zc.buildout/branches/regebro-python3/src/zc/buildout/download.txt
  U   zc.buildout/branches/regebro-python3/src/zc/buildout/upgrading_distribute.txt

-=-
Modified: zc.buildout/branches/regebro-python3/src/zc/buildout/dependencylinks.txt
===================================================================
--- zc.buildout/branches/regebro-python3/src/zc/buildout/dependencylinks.txt	2010-11-24 13:03:38 UTC (rev 118554)
+++ zc.buildout/branches/regebro-python3/src/zc/buildout/dependencylinks.txt	2010-11-24 13:16:36 UTC (rev 118555)
@@ -23,7 +23,7 @@
 
     >>> get(link_server2 + 'enable_server_logging')
     GET 200 /enable_server_logging
-    ''
+    b''
 
 Let's create a develop egg in our buildout that specifies
 dependency_links which point to the new server.
@@ -61,7 +61,6 @@
     Installing eggs.
     Getting distribution for 'demoneeded'.
     Got demoneeded 1.2c1.
-    <BLANKLINE>
 
 Notice that the egg was retrieved from the logging server.
 
@@ -91,7 +90,6 @@
       Updating eggs.
       Getting distribution for 'demoneeded'.
     Error: Couldn't find a distribution for 'demoneeded'.
-    <BLANKLINE>
 
 Now it can't find the dependency since neither the buildout
 configuration nor setup specifies where to look.
@@ -116,7 +114,6 @@
     Installing eggs.
     Getting distribution for 'demoneeded'.
     Got demoneeded 1.2c1.
-    <BLANKLINE>
 
 This time the dependency egg was found on the server without logging
 configured.
@@ -139,7 +136,6 @@
     Updating eggs.
     Getting distribution for 'demoneeded'.
     Got demoneeded 1.2c1.
-    <BLANKLINE>
 
 So when both setuptools and buildout specify places to search for
 eggs, the dependency_links takes precedence over find-links.
@@ -170,7 +166,6 @@
     Updating eggs.
     Getting distribution for 'demoneeded'.
     Got demoneeded 1.2c1.
-    <BLANKLINE>
 
 Notice that this time the egg isn't downloaded from the logging server.
 
@@ -196,5 +191,4 @@
     Updating eggs.
     Getting distribution for 'demoneeded'.
     Got demoneeded 1.2c1.
-    <BLANKLINE>
 

Modified: zc.buildout/branches/regebro-python3/src/zc/buildout/download.py
===================================================================
--- zc.buildout/branches/regebro-python3/src/zc/buildout/download.py	2010-11-24 13:03:38 UTC (rev 118554)
+++ zc.buildout/branches/regebro-python3/src/zc/buildout/download.py	2010-11-24 13:16:36 UTC (rev 118555)
@@ -35,6 +35,7 @@
 import tempfile
 
 import zc.buildout
+from zc.buildout.pycompat import b
 
 
 class URLOpener(FancyURLopener):
@@ -199,7 +200,7 @@
 
         """
         if self.hash_name:
-            return md5(url).hexdigest()
+            return md5(b(url)).hexdigest()
         else:
             if re.match(r"^[A-Za-z]:\\", url):
                 url = 'file:' + url

Modified: zc.buildout/branches/regebro-python3/src/zc/buildout/download.txt
===================================================================
--- zc.buildout/branches/regebro-python3/src/zc/buildout/download.txt	2010-11-24 13:03:38 UTC (rev 118554)
+++ zc.buildout/branches/regebro-python3/src/zc/buildout/download.txt	2010-11-24 13:16:36 UTC (rev 118555)
@@ -75,13 +75,13 @@
 ... except ImportError: from md5 import new as md5
 
 >>> path, is_temp = download(server_url+'foo.txt',
-...                          md5('This is a foo text.').hexdigest())
+...                          md5(b('This is a foo text.')).hexdigest())
 >>> is_temp
 True
 >>> remove(path)
 
 >>> download(server_url+'foo.txt',
-...          md5('The wrong text.').hexdigest())
+...          md5(b('The wrong text.')).hexdigest())
 Traceback (most recent call last):
 ChecksumError: MD5 checksum mismatch downloading 'http://localhost/foo.txt'
 
@@ -89,11 +89,11 @@
 reads somewhat differently:
 
 >>> download(join(server_data, 'foo.txt'),
-...               md5('This is a foo text.').hexdigest())
+...               md5(b('This is a foo text.')).hexdigest())
 ('/sample_files/foo.txt', False)
 
 >>> download(join(server_data, 'foo.txt'),
-...          md5('The wrong text.').hexdigest())
+...          md5(b('The wrong text.')).hexdigest())
 Traceback (most recent call last):
 ChecksumError: MD5 checksum mismatch for local resource at '/sample_files/foo.txt'.
 
@@ -168,7 +168,7 @@
 If we specify an MD5 checksum for a file that is already in the cache, the
 cached copy's checksum will be verified:
 
->>> download(server_url+'foo.txt', md5('The wrong text.').hexdigest())
+>>> download(server_url+'foo.txt', md5(b('The wrong text.')).hexdigest())
 Traceback (most recent call last):
 ChecksumError: MD5 checksum mismatch for cached download
                from 'http://localhost/foo.txt' at '/download-cache/foo.txt'
@@ -247,7 +247,7 @@
 
 However, resources with checksum mismatches will not be copied to the cache:
 
->>> download(server_url+'foo.txt', md5('The wrong text.').hexdigest())
+>>> download(server_url+'foo.txt', md5(b('The wrong text.')).hexdigest())
 Traceback (most recent call last):
 ChecksumError: MD5 checksum mismatch downloading 'http://localhost/foo.txt'
 >>> ls(cache)
@@ -337,7 +337,7 @@
 the test is run, so we don't actually know the full URL of the file. Let's
 check that the checksum actually belongs to the particular URL used:
 
->>> path.lower() == join(cache, md5(server_url+'foo.txt').hexdigest()).lower()
+>>> path.lower() == join(cache, md5(server_url+'foo.txt')).hexdigest()).lower()
 True
 
 The cached copy is used when downloading the file again:
@@ -359,7 +359,7 @@
 /download-cache/537b6d73267f8f4447586989af8c470e
 >>> path == path2
 False
->>> path2.lower() == join(cache, md5(server_url+'other/foo.txt').hexdigest()).lower()
+>>> path2.lower() == join(cache, md5(server_url+'other/foo.txt')).hexdigest()).lower()
 True
 >>> cat(path)
 This is a foo text.
@@ -439,7 +439,7 @@
 copy will neither be used nor overwritten:
 
 >>> write(server_data, 'foo.txt', 'This is a foo text.')
->>> download(server_url+'foo.txt', md5('The wrong text.').hexdigest())
+>>> download(server_url+'foo.txt', md5(b('The wrong text.')).hexdigest())
 Traceback (most recent call last):
 ChecksumError: MD5 checksum mismatch downloading 'http://localhost/foo.txt'
 >>> cat(cache, 'foo.txt')

Modified: zc.buildout/branches/regebro-python3/src/zc/buildout/upgrading_distribute.txt
===================================================================
--- zc.buildout/branches/regebro-python3/src/zc/buildout/upgrading_distribute.txt	2010-11-24 13:03:38 UTC (rev 118554)
+++ zc.buildout/branches/regebro-python3/src/zc/buildout/upgrading_distribute.txt	2010-11-24 13:16:36 UTC (rev 118555)
@@ -50,7 +50,5 @@
     ...     executable=sys.executable,
     ...     always_unzip=True)
     >>> installer._get_dist = mock_get_dist
-    >>> installer._call_easy_install('setuptools', None, dest, dist)
-    Traceback (most recent call last):
-    ...
-    UserError: Couldn't install: nonexisting.tgz
+    >>> assertRaises(zc.buildout.UserError,
+    ... installer._call_easy_install, 'setuptools', None, dest, dist)



More information about the checkins mailing list