Back to index

moin  1.9.0~rc2
test_macro.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003     MoinMoin - MoinMoin.macro Tests
00004 
00005     @copyright: 2003-2004 by Juergen Hermann <jh@web.de>,
00006                 2006 MoinMoin:ThomasWaldmann
00007     @license: GNU GPL, see COPYING for details.
00008 """
00009 
00010 from MoinMoin import macro
00011 from MoinMoin.parser.text import Parser
00012 from MoinMoin.formatter.text_html import Formatter
00013 from MoinMoin._tests import become_trusted, create_page, make_macro, nuke_page
00014 
00015 class TestMacro:
00016     pagename = u'AutoCreatedMoinMoinTemporaryTestPageForTestMacro'
00017 
00018     def setup_class(self):
00019         request = self.request
00020         become_trusted(request)
00021         self.page = create_page(request, self.pagename, u"Foo!")
00022 
00023     def teardown_class(self):
00024         nuke_page(self.request, self.pagename)
00025 
00026     def testTrivialMacro(self):
00027         """macro: trivial macro works"""
00028         m = make_macro(self.request, self.page)
00029         expected = m.formatter.linebreak(0)
00030         result = m.execute("BR", "")
00031         assert result == expected
00032 
00033 coverage_modules = ['MoinMoin.macro']
00034