[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools/tests -
test_cvsloader.py:1.3
Fred L. Drake, Jr.
fred at zope.com
Tue Mar 9 11:11:25 EST 2004
Update of /cvs-repository/Packages/zpkgtools/zpkgtools/tests
In directory cvs.zope.org:/tmp/cvs-serv20496
Modified Files:
test_cvsloader.py
Log Message:
add tests of the edge case of a repository: URL that doesn't specify a
path component
=== Packages/zpkgtools/zpkgtools/tests/test_cvsloader.py 1.2 => 1.3 ===
--- Packages/zpkgtools/zpkgtools/tests/test_cvsloader.py:1.2 Mon Mar 8 14:22:13 2004
+++ Packages/zpkgtools/zpkgtools/tests/test_cvsloader.py Tue Mar 9 11:11:24 2004
@@ -125,6 +125,35 @@
self.assertEqual(result.path, "project/module/relative/path")
self.assertEqual(result.tag, "FOO")
+ def test_repository_join_without_path(self):
+ repo = cvsloader.RepositoryUrl(None)
+ cvsurl = cvsloader.CvsUrl("", "cvs.example.org", "/cvsroot",
+ "project/module")
+ result = repo.join(cvsurl)
+ self.assert_(not result.type)
+ self.assertEqual(result.host, "cvs.example.org")
+ self.assertEqual(result.cvsroot, "/cvsroot")
+ self.assertEqual(result.path, "project/module")
+ self.assert_(not result.tag)
+
+ cvsurl.tag = "TAG"
+ result = repo.join(cvsurl)
+ self.assert_(not result.type)
+ self.assertEqual(result.host, "cvs.example.org")
+ self.assertEqual(result.cvsroot, "/cvsroot")
+ self.assertEqual(result.path, "project/module")
+ self.assertEqual(result.tag, "TAG")
+
+ repo.tag = "FOO"
+ result = repo.join(cvsurl)
+ self.assertEqual(result.path, "project/module")
+ self.assertEqual(result.tag, "FOO")
+
+ cvsurl.tag = None
+ result = repo.join(cvsurl)
+ self.assertEqual(result.path, "project/module")
+ self.assertEqual(result.tag, "FOO")
+
def test_parse_cvs(self):
def check(url,
type, username, password, host, cvsroot, path, tag):
More information about the Zope-CVS
mailing list