changeset 2897:7f07db1306d1

makes ItemCache happy if shutil.rmtree is used
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 23 Oct 2007 00:37:23 +0200
parents 179099ff37c8
children dd2226c7f5fe
files MoinMoin/_tests/test_wikidicts.py MoinMoin/action/_tests/test_attachfile.py MoinMoin/macro/_tests/test_Hits.py MoinMoin/macro/_tests/test_ImageLink.py MoinMoin/security/_tests/test_security.py
diffstat 5 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_wikidicts.py	Sun Oct 21 13:42:00 2007 +0200
+++ b/MoinMoin/_tests/test_wikidicts.py	Tue Oct 23 00:37:23 2007 +0200
@@ -137,6 +137,7 @@
 
         # real delete AnotherGroup page from filesystem
         import shutil
+        page.deletePage()
         fpath = page.getPagePath(check_create=0)
         shutil.rmtree(fpath, True)
 
@@ -164,12 +165,14 @@
         # real delete AnotherGroup page from filesystem
         import shutil
         page = PageEditor(self.request, u'OtherGroup', do_editor_backup=0)
+        page.deletePage()
         fpath = page.getPagePath(check_create=0)
         shutil.rmtree(fpath, True)
 
         # real delete AnotherGroup page from filesystem
         import shutil
         page = PageEditor(self.request, u'SomeGroup', do_editor_backup=0)
+        page.deletePage()
         fpath = page.getPagePath(check_create=0)
         shutil.rmtree(fpath, True)
 
--- a/MoinMoin/action/_tests/test_attachfile.py	Sun Oct 21 13:42:00 2007 +0200
+++ b/MoinMoin/action/_tests/test_attachfile.py	Tue Oct 23 00:37:23 2007 +0200
@@ -40,6 +40,7 @@
     # real delete pagename from filesystem
     import shutil
     page = PageEditor(request, pagename, do_editor_backup=0)
+    page.deletePage()
     fpath = page.getPagePath(check_create=0)
     shutil.rmtree(fpath, True)
 
--- a/MoinMoin/macro/_tests/test_Hits.py	Sun Oct 21 13:42:00 2007 +0200
+++ b/MoinMoin/macro/_tests/test_Hits.py	Tue Oct 23 00:37:23 2007 +0200
@@ -28,7 +28,8 @@
     def teardown_class(self):
         if self.shouldDeleteTestPage:
             import shutil
-            page = Page(self.request, self.pagename)
+            page = PageEditor(self.request, self.pagename)
+            page.deletePage()
             fpath = page.getPagePath(use_underlay=0, check_create=0)
             shutil.rmtree(fpath, True)
 
--- a/MoinMoin/macro/_tests/test_ImageLink.py	Sun Oct 21 13:42:00 2007 +0200
+++ b/MoinMoin/macro/_tests/test_ImageLink.py	Tue Oct 23 00:37:23 2007 +0200
@@ -25,7 +25,8 @@
     def teardown_class(self):
         if self.shouldDeleteTestPage:
             import shutil
-            page = Page(self.request, self.pagename)
+            page = PageEditor(self.request, self.pagename)
+            page.deletePage()
             fpath = page.getPagePath(use_underlay=0, check_create=0)
             shutil.rmtree(fpath, True)
 
--- a/MoinMoin/security/_tests/test_security.py	Sun Oct 21 13:42:00 2007 +0200
+++ b/MoinMoin/security/_tests/test_security.py	Tue Oct 23 00:37:23 2007 +0200
@@ -251,7 +251,7 @@
         pagename = u'AutoCreatedMoinMoinTemporaryTestPage'
 
         result = self.request.user.may.write(pagename)
-        page = Page(self.request, pagename)
+        page = PageEditor(self.request, pagename)
         path = page.getPagePath(use_underlay=0, check_create=0)
         if os.path.exists(path):
             py.test.skip("%s exists. Won't overwrite exiting page" % self.dictPage)
@@ -272,6 +272,7 @@
         finally:
             if os.path.exists(path):
                 import shutil
+                page.deletePage()
                 shutil.rmtree(path, True)
 
 coverage_modules = ['MoinMoin.security']