[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools/tests - test_loader.py:1.6 test_svnloader.py:1.4

Fred L. Drake, Jr. fred at zope.com
Thu May 6 13:35:44 EDT 2004


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

Modified Files:
	test_loader.py test_svnloader.py 
Log Message:
add general support for Subversion's svn+something: URL schemes


=== Packages/zpkgtools/zpkgtools/tests/test_loader.py 1.5 => 1.6 ===
--- Packages/zpkgtools/zpkgtools/tests/test_loader.py:1.5	Sat May  1 23:26:04 2004
+++ Packages/zpkgtools/zpkgtools/tests/test_loader.py	Thu May  6 13:35:13 2004
@@ -108,6 +108,25 @@
         eq(convert("local/path/reference.conf"),
            "local/path/reference.conf")
 
+    def test_load_with_svn_special(self):
+        URL = ("svn+foo://svn.example.net/path/to/svnroot/"
+               "project/tags/*/file.txt")
+        class MyError(Exception):
+            def __init__(self, url):
+                self.url = url
+        def my_load(url):
+            raise MyError(url)
+        loader = self.createLoader(tag="SPLAT")
+        loader.load_svn = my_load
+        try:
+            loader.load(URL)
+        except MyError, e:
+            self.assertEqual(e.url,
+                             ("svn+foo://svn.example.net/path/to/svnroot/"
+                              "project/tags/SPLAT/file.txt"))
+        else:
+            self.fail("expected the general Subversion handler to be called")
+
     def test_load_with_file(self):
         filename = os.path.abspath(__file__)
         URL = "file://" + urllib.pathname2url(filename)


=== Packages/zpkgtools/zpkgtools/tests/test_svnloader.py 1.3 => 1.4 ===
--- Packages/zpkgtools/zpkgtools/tests/test_svnloader.py:1.3	Sat May  1 23:25:46 2004
+++ Packages/zpkgtools/zpkgtools/tests/test_svnloader.py	Thu May  6 13:35:13 2004
@@ -193,6 +193,12 @@
     TYPE = "svn+ssh"
 
 
+class SubversionPlusSpecialUrlTestCase(SubversionUrlTestCase):
+    """Test handling of svn+other://host/... URLs."""
+
+    TYPE = "svn+other"
+
+
 class SubversionFileUrlTestCase(SubversionLocalRepositoryBase,
                                 SubversionUrlTestCase):
     """Test handling of file:///... URLs."""
@@ -207,6 +213,7 @@
 def test_suite():
     suite = unittest.makeSuite(SubversionUrlTestCase)
     suite.addTest(unittest.makeSuite(SubversionSshUrlTestCase))
+    suite.addTest(unittest.makeSuite(SubversionPlusSpecialUrlTestCase))
     suite.addTest(unittest.makeSuite(SubversionFileUrlTestCase))
     suite.addTest(unittest.makeSuite(SubversionLocalhostFileUrlTestCase))
     return suite




More information about the Zope-CVS mailing list