changeset 1047:51086fe55b58

Added clearing to the TagStore, use it in the test.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sat, 22 Jul 2006 13:38:15 +0200
parents 9a124201327c
children b7544e3bd478
files MoinMoin/_tests/test_wikisync.py MoinMoin/wikisync.py
diffstat 2 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_wikisync.py	Sat Jul 22 13:26:39 2006 +0200
+++ b/MoinMoin/_tests/test_wikisync.py	Sat Jul 22 13:38:15 2006 +0200
@@ -22,12 +22,15 @@
     def setUp(self):
         if not getattr(self.request.cfg, 'is_test_wiki', False):
             raise TestSkipped('This test needs to be run using the test wiki.')
+        self.page = PageEditor(self.request, "FrontPage")
 
     def testBasicTagThings(self):
-        page = PageEditor(self.request, "FrontPage")
-        tags = TagStore(page)
+        tags = TagStore(self.page)
         self.assert_(not tags.get_all_tags())
         tags.add(remote_wiki="foo", remote_rev=1, current_rev=2)
-        tags = TagStore(page) # reload
+        tags = TagStore(self.page) # reload
         self.assert_(tags.get_all_tags()[0].remote_rev == 1)
-
+    
+    def tearDown(self):
+        tags = TagStore(self.page)
+        tags.clear()
--- a/MoinMoin/wikisync.py	Sat Jul 22 13:26:39 2006 +0200
+++ b/MoinMoin/wikisync.py	Sat Jul 22 13:38:15 2006 +0200
@@ -47,6 +47,10 @@
     def get_all_tags(self):
         """ Returns a list of all Tag objects associated to this page. """
         return NotImplemented
+    
+    def clear(self):
+        """ Removes all tags. """
+        return NotImplemented
 
 
 class PickleTagStore(AbstractTagStore):
@@ -86,6 +90,9 @@
     def get_all_tags(self):
         return self.tags
 
+    def clear(self):
+        self.tags = []
+        self.commit()
 
 # currently we just have one implementation, so we do not need
 # a factory method