[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools/tests -
test_svnloader.py:1.7
Fred L. Drake, Jr.
fred at zope.com
Thu Jun 10 18:59:56 EDT 2004
Update of /cvs-repository/Packages/zpkgtools/zpkgtools/tests
In directory cvs.zope.org:/tmp/cvs-serv6914/zpkgtools/tests
Modified Files:
test_svnloader.py
Log Message:
fix bug in joining a Subversion URL with a repository: URL
=== Packages/zpkgtools/zpkgtools/tests/test_svnloader.py 1.6 => 1.7 ===
--- Packages/zpkgtools/zpkgtools/tests/test_svnloader.py:1.6 Fri May 7 15:33:30 2004
+++ Packages/zpkgtools/zpkgtools/tests/test_svnloader.py Thu Jun 10 18:59:55 2004
@@ -155,7 +155,36 @@
eq(split("/tags/foo/file.txt"), ("", "file.txt", "foo"))
eq(split("/tags/*/file.txt"), ("", "file.txt", None))
- def test_join(self):
+ def test_join_with_path(self):
+ URL = self.mkurl("/tags/*/path")
+ repo = cvsloader.parse("repository:more/path")
+ svnurl = svnloader.parse(URL)
+ newurl = svnurl.join(repo)
+ self.assertEqual(newurl.tag, None)
+ self.assertEqual(newurl.prefix, self.mkurl(""))
+ self.assertEqual(newurl.tail, "path/more/path")
+
+ def test_join_with_path_and_new_tag(self):
+ eq = self.assertEqual
+
+ URL = self.mkurl("/tags/*/path")
+ repo = cvsloader.parse("repository:more/path:TAG")
+ svnurl = svnloader.parse(URL)
+ newurl = svnurl.join(repo)
+ eq(newurl.tag, "TAG")
+ eq(newurl.prefix, self.mkurl(""))
+ eq(newurl.tail, "path/more/path")
+ eq(newurl.getUrl(), self.mkurl("/tags/TAG/path/more/path"))
+
+ repo = cvsloader.parse("repository:more/path:HEAD")
+ svnurl = svnloader.parse(URL)
+ newurl = svnurl.join(repo)
+ eq(newurl.tag, "HEAD")
+ eq(newurl.prefix, self.mkurl(""))
+ eq(newurl.tail, "path/more/path")
+ eq(newurl.getUrl(), self.mkurl("/trunk/path/more/path"))
+
+ def test_join_with_just_new_tag(self):
eq = self.assertEqual
svnroot = self.mkurl("")
More information about the Zope-CVS
mailing list