Back to index

moin  1.9.0~rc2
test_wiki_dicts.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003     MoinMoin - MoinMoin.datastruct.backends.wiki_dicts tests
00004 
00005     @copyright: 2003-2004 by Juergen Hermann <jh@web.de>,
00006                 2007 by MoinMoin:ThomasWaldmann
00007                 2009 by MoinMoin:DmitrijsMilajevs
00008     @license: GNU GPL, see COPYING for details.
00009 """
00010 
00011 
00012 from MoinMoin.datastruct.backends._tests import DictsBackendTest
00013 from MoinMoin.datastruct.backends import wiki_dicts
00014 from MoinMoin._tests import become_trusted, create_page, nuke_page
00015 
00016 
00017 class TestWikiDictsBackend(DictsBackendTest):
00018 
00019     # Suppose that default configuration for the dicts is used which
00020     # is WikiDicts backend.
00021 
00022     def setup_class(self):
00023         request = self.request
00024         become_trusted(request)
00025 
00026         text = '''
00027 Text ignored
00028  * list items ignored
00029   * Second level list ignored
00030  First:: first item
00031  text with spaces:: second item
00032 
00033 Empty lines ignored, so is this text
00034 Next line has key with empty value
00035  Empty string::\x20
00036  Last:: last item
00037 '''
00038         create_page(request, u'SomeTestDict', text)
00039 
00040         text = """
00041  One:: 1
00042  Two:: 2
00043 """
00044         create_page(request, u'SomeOtherTestDict', text)
00045 
00046     def teardown_class(self):
00047         become_trusted(self.request)
00048         nuke_page(self.request, u'SomeTestDict')
00049         nuke_page(self.request, u'SomeOtherTestDict')
00050 
00051 
00052 coverage_modules = ['MoinMoin.datastruct.backends.wiki_dicts']
00053