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

Jim Fulton <[email protected]>
Newsgroups gmane.comp.web.zope.public-cvs
Message-ID <[email protected]>
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))

_______________________________________________
Zope-CVS maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zope-cvs

Zope CVS instructions: http://dev.zope.org/CVS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.