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

Fred L. Drake, Jr. fred at zope.com
Mon Apr 19 11:38:27 EDT 2004


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

Modified Files:
	test_include.py 
Log Message:
- make the tests clean up after themselves
- fix test that wasn't setting up the input correctly


=== Packages/zpkgtools/zpkgtools/tests/test_include.py 1.10 => 1.11 ===
--- Packages/zpkgtools/zpkgtools/tests/test_include.py:1.10	Mon Apr 19 10:33:31 2004
+++ Packages/zpkgtools/zpkgtools/tests/test_include.py	Mon Apr 19 11:38:24 2004
@@ -34,9 +34,13 @@
         self.destination = tempfile.mkdtemp(prefix="test_include_")
         self.processor = include.InclusionProcessor(self.source)
         self.source = os.path.abspath(self.source)
+        self.files_written = []
 
     def tearDown(self):
         shutil.rmtree(self.destination)
+        for path in self.files_written:
+            if os.path.exists(path):
+                os.unlink(path)
 
     def write_file(self, name, text):
         path = join(self.source, name)
@@ -45,6 +49,7 @@
         f = open(path, "w")
         f.write(text)
         f.close()
+        self.files_written.append(path)
 
     def test_simple_includespec(self):
         self.write_file(include.PACKAGE_CONF, """\
@@ -90,7 +95,7 @@
             self.fail("expected InclusionSpecificationError")
 
     def test_error_on_omitted_source(self):
-        f = StringIO("""\
+        self.write_file(include.PACKAGE_CONF, """\
             <collection>
               whatzit.txt
             </collection>




More information about the Zope-CVS mailing list