[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools/tests -
test_svnloader.py:1.5
Fred L. Drake, Jr.
fred at zope.com
Thu May 6 14:45:45 EDT 2004
Update of /cvs-repository/Packages/zpkgtools/zpkgtools/tests
In directory cvs.zope.org:/tmp/cvs-serv17064
Modified Files:
test_svnloader.py
Log Message:
add tests for zpkgtools.svnloader.is_subversion_url()
=== Packages/zpkgtools/zpkgtools/tests/test_svnloader.py 1.4 => 1.5 ===
--- Packages/zpkgtools/zpkgtools/tests/test_svnloader.py:1.4 Thu May 6 13:35:13 2004
+++ Packages/zpkgtools/zpkgtools/tests/test_svnloader.py Thu May 6 14:45:44 2004
@@ -186,6 +186,30 @@
eq(newurl.tail, "file.txt")
eq(newurl.getUrl(), self.mkurl("/tags/FOO/file.txt"))
+ def test_is_subversion_url(self):
+ note = " (repo in %s)" % self.SVNROOT
+ def check(path):
+ # what's expected to pass:
+ url = self.mkurl(path)
+ self.assert_(svnloader.is_subversion_url(url), url + note)
+ # invalid scheme:
+ url = "x" + url
+ self.assert_(not svnloader.is_subversion_url(url), url + note)
+ check("")
+ check("/")
+ check("/foo/bar")
+ check("/foo/bar/")
+ check("/foo/bar.txt")
+ check("/trunk/foo/bar.txt")
+ check("/tags/foobar/foo/bar.txt")
+ check("/branches/foobar/foo/bar.txt")
+ # Things that don't look like URLs at all:
+ self.assert_(not svnloader.is_subversion_url("some/path"))
+ self.assert_(not svnloader.is_subversion_url("/some/path"))
+ self.assert_(not svnloader.is_subversion_url("/"))
+ self.assert_(not svnloader.is_subversion_url("/foo.txt"))
+ self.assert_(not svnloader.is_subversion_url("foo/"))
+
class SubversionSshUrlTestCase(SubversionUrlTestCase):
"""Test handling of svn+ssh://host/... URLs."""
More information about the Zope-CVS
mailing list