view MoinMoin/macro/_tests/ @ 4043:adf9f4a9cfb5

macro._tests: refactored duplicated code to common methods
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 16 Aug 2008 10:18:23 +0200
parents 6bd61e4063e3
children 62b9f61eb526
line wrap: on
line source

# -*- coding: utf-8 -*-
    MoinMoin - MoinMoin.macro.FootNote Tests

    @copyright: 2008 MoinMoin:ReimarBauer

    @license: GNU GPL, see COPYING for details.
import os
from MoinMoin import macro
from MoinMoin.macro import FootNote
from MoinMoin.Page import Page
from MoinMoin.PageEditor import PageEditor

from MoinMoin._tests import become_trusted, create_page, make_macro, nuke_page

class TestFootNote:
    """ testing macro Action calling action raw """
    pagename = u'AutoCreatedMoinMoinTemporaryTestPageForFootNote'

    def setup_class(self):
        become_trusted(self.request) = create_page(self.request, self.pagename, u"Foo!")

    def teardown_class(self):
        nuke_page(self.request, self.pagename)

    def test_enumbering(self):
        """ module_tested: enumbering of Footnotes"""
        m = make_macro(self.request,
        text = 'a'
        FootNote.execute(m, text)
        text = 'b'
        FootNote.execute(m, text)
        result = FootNote.emit_footnotes(m.request, m.request.formatter)

        assert result.endswith('2</a>)</li></ol></div>')

coverage_modules = ['MoinMoin.macro.FootNote']