[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools/tests - test_include.py:1.18

Fred L. Drake, Jr. fred at zope.com
Tue May 25 10:34:49 EDT 2004


Update of /cvs-repository/Packages/zpkgtools/zpkgtools/tests
In directory cvs.zope.org:/tmp/cvs-serv30568/tests

Modified Files:
	test_include.py 
Log Message:
make sure nested PACKAGE.cfg files are processed


=== Packages/zpkgtools/zpkgtools/tests/test_include.py 1.17 => 1.18 ===
--- Packages/zpkgtools/zpkgtools/tests/test_include.py:1.17	Thu May 20 12:35:36 2004
+++ Packages/zpkgtools/zpkgtools/tests/test_include.py	Tue May 25 10:34:19 2004
@@ -296,6 +296,40 @@
         finally:
             shutil.rmtree(foodir)
 
+    def test_createDistributionTree_nested_excludes(self):
+        self.source = os.path.join(self.source, "input", "collection-1")
+        specs = include.load(self.source)
+        specs.collection.cook()
+        self.processor.createDistributionTree(self.destination,
+                                              specs.collection)
+        implied = os.path.join(self.destination, "implied")
+        self.assert_(os.path.isdir(implied))
+        self.failIf(os.path.exists(os.path.join(implied, "dropped.txt")))
+
+    def test_createDistributionTree_nested_includes(self):
+        self.write_file(os.path.join("input", "package", include.PACKAGE_CONF),
+                        "<collection>\n"
+                        "  something.py __init__.py\n"
+                        "</collection>\n")
+        specs = include.load(self.source)
+        specs.collection.cook()
+        self.processor.createDistributionTree(self.destination,
+                                              specs.collection)
+        destdir = os.path.join(self.destination, "input", "package")
+        self.assert_(os.path.isfile(os.path.join(destdir, "something.py")))
+        self.failIf(os.path.exists(os.path.join(destdir, "__init__.py")))
+
+    def test_nested_loads_disallowed(self):
+        self.write_file(os.path.join("input", "package", include.PACKAGE_CONF),
+                        "<load>\n"
+                        "  something.py http://www.example.org/\n"
+                        "</load>\n")
+        specs = include.load(self.source)
+        specs.collection.cook()
+        self.assertRaises(include.InclusionSpecificationError,
+                          self.processor.createDistributionTree,
+                          self.destination, specs.collection)
+
     def check_file(self, name):
         srcname = join(self.source, name)
         destname = join(self.destination, name)




More information about the Zope-CVS mailing list