changeset 1336:bf59bd23289b

Some cleanup, fixed packages test because the default test user is not allowed to delete pages.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sat, 19 Aug 2006 23:04:04 +0200
parents 2cd1b40ea3e7
children 5ffa0d1ae026
files MoinMoin/_tests/test_packages.py MoinMoin/action/SyncPages.py MoinMoin/wikisync.py
diffstat 3 files changed, 2 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_packages.py	Sat Aug 19 22:53:21 2006 +0200
+++ b/MoinMoin/_tests/test_packages.py	Sat Aug 19 23:04:04 2006 +0200
@@ -21,13 +21,11 @@
         self.script = script or u"""moinmoinpackage|1
 print|foo
 ReplaceUnderlay|testdatei|TestSeite2
-DeletePage|TestSeite2|Test ...
 IgnoreExceptions|True
 DeletePage|TestSeiteDoesNotExist|Test ...
 IgnoreExceptions|False
 AddRevision|foofile|FooPage
 AddRevision|foofile|FooPage
-DeletePage|FooPage|Test ...
 setthemename|foo
 #foobar
 installplugin|foo|local|parser|testy
@@ -60,7 +58,6 @@
         testseite2 = Page(self.request, 'TestSeite2')
         self.assertEqual(testseite2.getPageText(), "Hello world, I am the file testdatei")
         self.assert_(testseite2.isUnderlayPage())
-        self.assert_(not Page(self.request, 'FooPage').exists())
 
 class QuotingTestCase(TestCase):
     def testQuoting(self):
--- a/MoinMoin/action/SyncPages.py	Sat Aug 19 22:53:21 2006 +0200
+++ b/MoinMoin/action/SyncPages.py	Sat Aug 19 23:04:04 2006 +0200
@@ -172,7 +172,8 @@
                           |          | do a sync without considering tags
                 with tags | with non | to ensure data integrity.
                           | matching | Hmm, how do we detect this
-                          | tags     | case if the unmatching tags are only on the remote side?
+                          | tags     | case if the unmatching tags are only
+                          |          | on the remote side?
                 ----------+----------+-------------------------------
         """
         _ = lambda x: x # we will translate it later
@@ -358,16 +359,6 @@
 
             # XXX release lock
 
-        # XXX remove?
-        #on_both_sides = SyncPage.iter_local_and_remote(m_pages)
-        #remote_but_not_local = SyncPage.iter_remote_only(m_pages)
-        #local_but_not_remote = SyncPage.iter_local_only(m_pages)
-
-        # some initial test code (XXX remove)
-        #r_new_pages = u", ".join([unicode(x) for x in remote_but_not_local])
-        #l_new_pages = u", ".join([unicode(x) for x in local_but_not_remote])
-        #raise ActionStatus("These pages are in the remote wiki, but not local: " + wikiutil.escape(r_new_pages) + "<br>These pages are in the local wiki, but not in the remote one: " + wikiutil.escape(l_new_pages))
-
         for rp in m_pages:
             handle_page(rp)
 
--- a/MoinMoin/wikisync.py	Sat Aug 19 22:53:21 2006 +0200
+++ b/MoinMoin/wikisync.py	Sat Aug 19 23:04:04 2006 +0200
@@ -134,26 +134,6 @@
         """ Is true if the page is in both wikis. """
         return self.local_rev and self.remote_rev
 
-    def iter_local_only(cls, sp_list):
-        """ Iterates over all pages that are local only. """
-        for x in sp_list:
-            if x.is_only_local():
-                yield x
-    iter_local_only = classmethod(iter_local_only)
-
-    def iter_remote_only(cls, sp_list):
-        """ Iterates over all pages that are remote only. """
-        for x in sp_list:
-            if x.is_only_remote():
-                yield x
-    iter_remote_only = classmethod(iter_remote_only)
-
-    def iter_local_and_remote(cls, sp_list):
-        """ Iterates over all pages that are local and remote. """
-        for x in sp_list:
-            if x.is_local_and_remote():
-                yield x
-    iter_local_and_remote = classmethod(iter_local_and_remote)
 
 class RemoteWiki(object):
     """ This class should be the base for all implementations of remote wiki