Back to index

moin  1.9.0~rc2
test_wikisync.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003     MoinMoin - MoinMoin.wikisync tests
00004 
00005     @copyright: 2006 MoinMoin:AlexanderSchremmer
00006     @license: GNU GPL, see COPYING for details.
00007 """
00008 
00009 import py
00010 
00011 from MoinMoin.PageEditor import PageEditor
00012 from MoinMoin.wikisync import TagStore, BOTH
00013 
00014 
00015 class TestUnsafeSync(object):
00016     """ Tests various things related to syncing. Note that it is not possible
00017         to create pages without cluttering page revision currently, so we have to use
00018         the testwiki. """
00019 
00020     def setup_method(self, method):
00021         if not getattr(self.request.cfg, 'is_test_wiki', False):
00022             py.test.skip('This test needs to be run using the test wiki.')
00023         self.page = PageEditor(self.request, "FrontPage")
00024 
00025     def testBasicTagThings(self):
00026         tags = TagStore(self.page)
00027         assert not tags.get_all_tags()
00028         tags.add(remote_wiki="foo", remote_rev=1, current_rev=2, direction=BOTH, normalised_name="FrontPage")
00029         tags = TagStore(self.page) # reload
00030         dummy = repr(tags.get_all_tags()) # this should not raise
00031         assert tags.get_all_tags()[0].remote_rev == 1
00032 
00033     def teardown_method(self, method):
00034         tags = TagStore(self.page)
00035         tags.clear()
00036 
00037 coverage_modules = ['MoinMoin.wikisync']
00038