[Zope-CVS] SVN: zpkgtools/branches/jim-relpath/zpkgtools/tests/test_locationmap.py Added missing test cases.

Jim Fulton jim at zope.com
Thu Jun 9 07:01:42 EDT 2005


Log message for revision 30694:
  Added missing test cases.
  

Changed:
  U   zpkgtools/branches/jim-relpath/zpkgtools/tests/test_locationmap.py

-=-
Modified: zpkgtools/branches/jim-relpath/zpkgtools/tests/test_locationmap.py
===================================================================
--- zpkgtools/branches/jim-relpath/zpkgtools/tests/test_locationmap.py	2005-06-09 08:07:15 UTC (rev 30693)
+++ zpkgtools/branches/jim-relpath/zpkgtools/tests/test_locationmap.py	2005-06-09 11:01:42 UTC (rev 30694)
@@ -335,6 +335,7 @@
         self.assertEqual(m["bat"], 3)
 
     def test_load_w_relative_paths(self):
+
         map_file = StringIO('''
 foo     svn+ssh://svn.zope.org/repos/main/Foo/trunk/src/foo
 bar     ../../bar
@@ -359,7 +360,7 @@
         mappingRelBase = locationmap.load(map_file, 'special/demo')
 
         map_file.seek(0)
-        mappingUrlBase = locationmap.load(map_file, 'http://acme.com/xxx')
+        mappingUrlBase = locationmap.load(map_file, 'http://acme.com/xxx/yyy/')
 
         os.getcwd = old_getcwd
 
@@ -391,24 +392,45 @@
             mappingNone['baz'],
             'file:///home/dudette/python/project/baz',
             )
-            
 
+        self.assertEqual(
+            mapping['bar'],
+            'file:///home/dudette/bar',
+            )
+        self.assertEqual(
+            mapping['baz'],
+            'file:///home/dudette/python/project/baz',
+            )
 
+        self.assertEqual(
+            mappingAbsBase['bar'],
+            'file:///projects/bar',
+            )
+        self.assertEqual(
+            mappingAbsBase['baz'],
+            'file:///projects/special/demo/baz',
+            )
+            
 
-    """
-We often want to use relative file paths in location maps.
+        self.assertEqual(
+            mappingRelBase['bar'],
+            'file:///home/dudette/python/project/bar',
+            )
+        self.assertEqual(
+            mappingRelBase['baz'],
+            'file:///home/dudette/python/project/special/demo/baz',
+            )
 
-We can currently use URL, including file URLs.  But these must be absolute.
+        self.assertEqual(
+            mappingUrlBase['bar'],
+            'http://acme.com/bar',
+            )
+        self.assertEqual(
+            mappingUrlBase['baz'],
+            'http://acme.com/xxx/yyy/baz',
+            )
 
-Let's look at a sample map file that has several kinds of URLs and
-relative paths:
 
-
-Now, we'll load this map.  
-
-
-"""
-
 def test_suite():
     suite = unittest.makeSuite(LoadTestCase)
     suite.addTest(unittest.makeSuite(CvsWorkingDirectoryTestCase))



More information about the Zope-CVS mailing list