[Zope-CVS] SVN: zpkgtools/trunk/zpkgtools/tests/test_include.py make sure support directories for several revision control systems are

Fred L. Drake, Jr. fdrake at gmail.com
Fri Jul 30 12:09:52 EDT 2004


Log message for revision 26848:
  make sure support directories for several revision control systems are
  handled properly
  


Changed:
  U   zpkgtools/trunk/zpkgtools/tests/test_include.py


-=-
Modified: zpkgtools/trunk/zpkgtools/tests/test_include.py
===================================================================
--- zpkgtools/trunk/zpkgtools/tests/test_include.py	2004-07-30 15:01:11 UTC (rev 26847)
+++ zpkgtools/trunk/zpkgtools/tests/test_include.py	2004-07-30 16:09:51 UTC (rev 26848)
@@ -38,12 +38,21 @@
         self.processor = include.InclusionProcessor(self.loader)
         self.source = os.path.abspath(self.source)
         self.files_written = []
+        self.dirs_created = []
+        # now create from various revision control systems
+        self.create_dir("{arch}")
+        self.create_dir("CVS")
+        self.create_dir("_darcs")
+        self.create_dir(".svn")
 
     def tearDown(self):
         shutil.rmtree(self.destination)
         for path in self.files_written:
             if os.path.exists(path):
                 os.unlink(path)
+        for path in self.dirs_created:
+            if os.path.exists(path):
+                os.rmdir(path)
 
     def write_file(self, name, text):
         path = join(self.source, name)
@@ -54,6 +63,12 @@
         f.close()
         self.files_written.append(path)
 
+    def create_dir(self, name, *rest):
+        path = join(self.source, name, *rest)
+        if not os.path.isdir(path):
+            self.dirs_created.insert(0, path)
+            os.mkdir(path)
+
     def test_simple_includespec(self):
         self.write_file(include.PACKAGE_CONF, """\
           <load>
@@ -276,6 +291,9 @@
         self.check_file("somescript.py")
         self.assert_(not os.path.exists(join(self.destination, "CVS")))
         self.assert_(not os.path.exists(join(self.destination, ".cvsignore")))
+        self.assert_(not os.path.exists(join(self.destination, "{arch}")))
+        self.assert_(not os.path.exists(join(self.destination, "_darcs")))
+        self.assert_(not os.path.exists(join(self.destination, ".svn")))
 
     def test_createDistributionTree_excludes_file(self):
         self.write_file(include.PACKAGE_CONF, """\



More information about the Zope-CVS mailing list