view MoinMoin/macro/_tests/test_macro.py @ 3056:b7914fb12243

macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 21 Feb 2008 19:41:15 +0100
parents 01f2921e5fa4
children 7626f4760d9f
line wrap: on
line source

# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - MoinMoin.macro Tests

    @copyright: 2003-2004 by Juergen Hermann <jh@web.de>,
                2006 MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.
"""

from MoinMoin import macro
from MoinMoin.parser.text import Parser
from MoinMoin.formatter.text_html import Formatter


class TestMacro:
    def testTrivialMacro(self):
        """macro: trivial macro works"""
        m = self._make_macro()
        expected = m.formatter.linebreak(0)
        result = m.execute("BR", "")
        assert result == expected

    def _make_macro(self):
        """Test helper"""
        p = Parser("##\n", self.request)
        p.formatter = Formatter(self.request)
        self.request.formatter = p.formatter
        p.form = self.request.form
        m = macro.Macro(p)
        return m


coverage_modules = ['MoinMoin.macro']