[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools/tests -
test_package.py:1.3
Fred L. Drake, Jr.
fred at zope.com
Mon Apr 5 18:19:33 EDT 2004
Update of /cvs-repository/Packages/zpkgtools/zpkgtools/tests
In directory cvs.zope.org:/tmp/cvs-serv8152/tests
Modified Files:
test_package.py
Log Message:
loadCollectionInfo(): new function for loaded package-info like information
for a non-package component
=== Packages/zpkgtools/zpkgtools/tests/test_package.py 1.2 => 1.3 ===
--- Packages/zpkgtools/zpkgtools/tests/test_package.py:1.2 Thu Mar 18 13:04:58 2004
+++ Packages/zpkgtools/zpkgtools/tests/test_package.py Mon Apr 5 18:19:33 2004
@@ -111,6 +111,42 @@
self.assertRaises(cfgparser.ConfigurationError,
package.loadPackageInfo, "foo", self.tmpdir, "bar")
+ def test_collection_empty_pkginfo(self):
+ self.write_config("# empty configuration file\n")
+ pkginfo = package.loadCollectionInfo(self.tmpdir)
+ eq = self.assertEqual
+ eq(pkginfo.extensions, [])
+ eq(pkginfo.documentation, [])
+ eq(pkginfo.script, [])
+
+ def test_collection_missing_pkginfo(self):
+ pkginfo = package.loadCollectionInfo(self.tmpdir)
+ eq = self.assertEqual
+ eq(pkginfo.extensions, [])
+ eq(pkginfo.documentation, [])
+ eq(pkginfo.script, [])
+
+ def test_collection_pkginfo(self):
+ self.write_config("documentation doc/*\n"
+ "script bin/*.py\n")
+ os.mkdir(os.path.join(self.tmpdir, "doc"))
+ self.write_file(os.path.join("doc", "README.txt"),
+ "docs go here")
+ os.mkdir(os.path.join(self.tmpdir, "bin"))
+ self.write_file(os.path.join("bin", "runme.py"),
+ "#!/bin/sh\nexit\n")
+ pkginfo = package.loadCollectionInfo(self.tmpdir)
+ eq = self.assertEqual
+ eq(len(pkginfo.extensions), 0)
+ eq(pkginfo.documentation, ["doc/README.txt"])
+ eq(pkginfo.script, ["bin/runme.py"])
+
+ def test_collection_pkginfo_disallows_extensions(self):
+ self.write_config("<extension foo>\n"
+ " source foo.c\n"
+ "</extension>\n")
+ self.assertRaises(ValueError, package.loadCollectionInfo, self.tmpdir)
+
def test_suite():
suite = doctest.DocTestSuite("zpkgtools.package")
More information about the Zope-CVS
mailing list