[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools/tests -
test_loader.py:1.4
Fred L. Drake, Jr.
fred at zope.com
Tue Apr 27 14:50:31 EDT 2004
Update of /cvs-repository/Packages/zpkgtools/zpkgtools/tests
In directory cvs.zope.org:/tmp/cvs-serv15650/zpkgtools/tests
Modified Files:
test_loader.py
Log Message:
revise the insertion of the right tag into a Subversion URL so it happens at
the right time; added tests
=== Packages/zpkgtools/zpkgtools/tests/test_loader.py 1.3 => 1.4 ===
--- Packages/zpkgtools/zpkgtools/tests/test_loader.py:1.3 Tue Apr 27 12:37:29 2004
+++ Packages/zpkgtools/zpkgtools/tests/test_loader.py Tue Apr 27 14:50:31 2004
@@ -21,30 +21,34 @@
import urllib
from zpkgtools import loader
+from zpkgtools.tests import test_svnloader
class LoaderTestBase(unittest.TestCase):
def setUp(self):
+ super(LoaderTestBase, self).setUp()
self.workingdir = tempfile.mkdtemp(prefix="test-workdir-")
self.cvsdir = os.path.join(self.workingdir, "CVS")
os.mkdir(self.cvsdir)
def tearDown(self):
+ super(LoaderTestBase, self).tearDown()
shutil.rmtree(self.workingdir)
def createLoader(self, tag=None):
return loader.Loader(tag)
-class LoaderTestCase(LoaderTestBase):
+class LoaderTestCase(LoaderTestBase, test_svnloader.SubversionRepositoryBase):
def test_transform_url_with_default_tag(self):
convert = loader.Loader("TAG").transform_url
self.check_unchanging_urls(convert)
eq = self.assertEqual
# cvs:
-
+ eq(convert("cvs://cvs.example.org/cvsroot:module"),
+ "cvs://cvs.example.org/cvsroot:module:TAG")
# repository:
eq(convert("repository::"),
"repository::TAG")
@@ -52,6 +56,23 @@
"repository:path:TAG")
eq(convert("repository:/some/path/:"),
"repository:/some/path/:TAG")
+ # Subversion:
+ self.check_changing_subversion_urls("svn", "svn.example.org")
+ self.check_changing_subversion_urls("svn+ssh", "svn.example.org")
+ self.check_changing_subversion_urls("file", "",
+ prefix=self.svnrepodir)
+ self.check_changing_subversion_urls("file", "localhost",
+ prefix=self.svnrepodir)
+
+ def check_changing_subversion_urls(self, scheme, hostname, prefix=None):
+ if not prefix:
+ prefix = "/some/path/to/svnroot"
+ convert = loader.Loader("TAG").transform_url
+ eq = self.assertEqual
+ def mkurl(path):
+ return "%s://%s%s%s" % (scheme, hostname, prefix, path)
+ eq(convert(mkurl("/tags/*/module/file.txt")),
+ mkurl("/tags/TAG/module/file.txt"))
def test_transform_url_without_default_tag(self):
convert = loader.Loader().transform_url
More information about the Zope-CVS
mailing list