[Zope-dev] test.py and symlinks

Florent Guillaume fg at nuxeo.com
Tue Nov 16 11:33:52 EST 2004


I need this patch to make test.py work when some of my directories are 
symlinked elsewhere.

Without this, I can't run
   bin/zopectl test -vv --dir Products/CMFCore
when Products is a symlink and CMFCore is also a symlink.

I'll check it in soon unless someone sees a problem with it.

Thanks,
Florent

--- test.py.~1.2.2.15.~	2004-11-05 11:44:18.000000000 +0100
+++ test.py	2004-11-16 17:26:02.000000000 +0100
@@ -380,11 +380,12 @@
          self.cwd = os.path.realpath(os.getcwd())
          # Hack again for external products.
          if libdir:
-            self.libdir = os.path.realpath(os.path.join(self.cwd, libdir))
+            self.libdir = os.path.join(self.cwd, libdir)
          else:
-            self.libdir = os.path.realpath(os.path.join(self.cwd, 
self.libdir))
-        if self.libdir not in sys.path:
-            sys.path.insert(0, self.libdir)
+            self.libdir = os.path.join(self.cwd, self.libdir)
+        real_libdir = os.path.realpath(self.libdir)
+        if real_libdir not in sys.path:
+            sys.path.insert(0, real_libdir)
          # Determine where to look for tests
          if test_dir:
              self.testdir = os.path.abspath(os.path.join(self.cwd, 
test_dir))

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope-Dev mailing list