[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools/tests - test_locationmap.py:1.3

Fred L. Drake, Jr. fred at zope.com
Thu Mar 18 17:32:41 EST 2004


Update of /cvs-repository/Packages/zpkgtools/zpkgtools/tests
In directory cvs.zope.org:/tmp/cvs-serv18598/tests

Modified Files:
	test_locationmap.py 
Log Message:
make locationmap.fromPathOrUrl() do the right thing for non-"cvs:" URLs,
and make the test use that instead of the lower-level interface


=== Packages/zpkgtools/zpkgtools/tests/test_locationmap.py 1.2 => 1.3 ===
--- Packages/zpkgtools/zpkgtools/tests/test_locationmap.py:1.2	Thu Mar 18 16:23:48 2004
+++ Packages/zpkgtools/zpkgtools/tests/test_locationmap.py	Thu Mar 18 17:32:41 2004
@@ -17,6 +17,7 @@
 import logging
 import os.path
 import unittest
+import urllib
 
 from StringIO import StringIO
 
@@ -82,6 +83,18 @@
         mapping = locationmap.load(
             sio, "cvs://cvs.example.org:ext/cvsroot:module")
         self.check_sample_results(mapping)
+
+    def test_load_with_file_base(self):
+        dirname = os.path.dirname(os.path.abspath(__file__))
+        dirname = os.path.join(dirname, "input")
+        fn = os.path.join(dirname, "packages.map")
+        url = "file://" + urllib.pathname2url(fn)
+        map = locationmap.fromPathOrUrl(url)
+        base = "file://" + urllib.pathname2url(dirname)
+        self.assertEqual(map["collection:collection-1"],
+                         base + "/collection-1/")
+        self.assertEqual(map["collection:collection-2"],
+                         base + "/collection-2/")
 
     def check_sample_results(self, mapping):
         d = {}




More information about the Zope-CVS mailing list