[Python-checkins] distutils2: fixed a test mock issue (#14268)

tarek.ziade python-checkins at python.org
Mon Mar 12 22:46:02 CET 2012


http://hg.python.org/distutils2/rev/c0a9ba08ebe3
changeset:   1295:c0a9ba08ebe3
user:        Tarek Ziade <tarek at ziade.org>
date:        Mon Mar 12 14:45:50 2012 -0700
summary:
  fixed a test mock issue (#14268)

files:
  distutils2/install.py            |  3 ++-
  distutils2/tests/test_install.py |  6 +++---
  2 files changed, 5 insertions(+), 4 deletions(-)


diff --git a/distutils2/install.py b/distutils2/install.py
--- a/distutils2/install.py
+++ b/distutils2/install.py
@@ -244,7 +244,8 @@
         temp_dir = tempfile.mkdtemp()
         for dist in remove:
             files = dist.list_installed_files()
-            temp_files[dist] = _move_files(files, temp_dir)
+            paths = [path for path, md5, size in files]
+            temp_files[dist] = _move_files(paths, temp_dir)
     try:
         if install:
             install_dists(install, install_path, paths)
diff --git a/distutils2/tests/test_install.py b/distutils2/tests/test_install.py
--- a/distutils2/tests/test_install.py
+++ b/distutils2/tests/test_install.py
@@ -57,7 +57,7 @@
 
     def list_installed_files(self, **args):
         if self._files:
-            return self._real_files
+            return [(path, 'md5', 0) for path in self._real_files]
 
     def get_install(self, **args):
         return self.list_installed_files()
@@ -312,7 +312,7 @@
 
             # assert that the files have been removed
             for dist in dists:
-                for f in dist.list_installed_files():
+                for f, md5, size in dist.list_installed_files():
                     self.assertFalse(os.path.exists(f))
         finally:
             install.install_dists = old_install_dists
@@ -338,7 +338,7 @@
             # assert that the files are in the same place
             # assert that the files have been removed
             for dist in remove:
-                for f in dist.list_installed_files():
+                for f, md5, size in dist.list_installed_files():
                     self.assertTrue(os.path.exists(f))
                 dist._unlink_installed_files()
         finally:

-- 
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list