changeset 1037:e52ab62b3a0a

Added test for wikisync.py
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sat, 22 Jul 2006 01:59:19 +0200
parents eac4ea43088e
children e39b47ed9e2a
files MoinMoin/_tests/test_wikisync.py
diffstat 1 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/_tests/test_wikisync.py	Sat Jul 22 01:59:19 2006 +0200
@@ -0,0 +1,33 @@
+# -*- coding: iso-8859-1 -*-
+"""
+MoinMoin - MoinMoin.wikisync tests
+
+@copyright: 2006 MoinMoin:AlexanderSchremmer
+@license: GNU GPL, see COPYING for details.
+"""
+
+from unittest import TestCase
+from MoinMoin.Page import Page
+from MoinMoin.PageEditor import PageEditor
+from MoinMoin._tests import TestConfig, TestSkipped
+
+from MoinMoin.wikisync import TagStore
+
+
+class UnsafeSyncTestcase(TestCase):
+    """ Tests various things related to syncing. Note that it is not possible
+        to create pages without cluttering page revision currently, so we have to use
+        the testwiki. """
+
+    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.')
+
+    def testBasicTagThings(self):
+        page = PageEditor(self.request, "FrontPage")
+        tags = TagStore(page)
+        self.assert_(not tags.get_all_tags())
+        tags.add(remote_wiki="foo", remote_rev=1, current_rev=2)
+        tags = TagStore(page) # reload
+        self.assert_(tags.get_all_tags()[0].remote_rev == 1)
+