annotate MoinMoin/macro/_tests/test_FootNote.py @ 6133:a6283e189869 default tip

fixup: remove nonexisting passlib.utils._blowfish this was removed by the passlib 1.7.1 upgrade.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 01 Jun 2017 18:10:19 +0200
parents 62b9f61eb526
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3056
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
2 """
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
3 MoinMoin - MoinMoin.macro.FootNote Tests
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
4
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
5 @copyright: 2008 MoinMoin:ReimarBauer
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
6 @license: GNU GPL, see COPYING for details.
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
7 """
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
8 import os
3948
62b9f61eb526 macro._tests: whitespace removed, docstring adjusted
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3947
diff changeset
9
3056
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
10 from MoinMoin import macro
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
11 from MoinMoin.macro import FootNote
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
12 from MoinMoin.Page import Page
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
13 from MoinMoin.PageEditor import PageEditor
3947
7626f4760d9f macro._tests: refactored duplicated code to common methods
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3670
diff changeset
14 from MoinMoin._tests import become_trusted, create_page, make_macro, nuke_page
3056
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
15
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
16 class TestFootNote:
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
17 """ testing macro Action calling action raw """
3504
7ee94ad36708 tests: test page creation/deletion now done by helpers in MoinMoin._tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3244
diff changeset
18 pagename = u'AutoCreatedMoinMoinTemporaryTestPageForFootNote'
3056
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
19
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
20 def setup_class(self):
3504
7ee94ad36708 tests: test page creation/deletion now done by helpers in MoinMoin._tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3244
diff changeset
21 become_trusted(self.request)
7ee94ad36708 tests: test page creation/deletion now done by helpers in MoinMoin._tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3244
diff changeset
22 self.page = create_page(self.request, self.pagename, u"Foo!")
3056
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
23
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
24 def teardown_class(self):
3504
7ee94ad36708 tests: test page creation/deletion now done by helpers in MoinMoin._tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3244
diff changeset
25 nuke_page(self.request, self.pagename)
3056
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
26
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
27 def test_enumbering(self):
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
28 """ module_tested: enumbering of Footnotes"""
3947
7626f4760d9f macro._tests: refactored duplicated code to common methods
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3670
diff changeset
29 m = make_macro(self.request, self.page)
3056
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
30 text = 'a'
3670
a799b224389f macro.FootNote: reverted changeset 3243 1ad6243cdf06, fixed test (port from 1.7)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3504
diff changeset
31 FootNote.execute(m, text)
3056
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
32 text = 'b'
3670
a799b224389f macro.FootNote: reverted changeset 3243 1ad6243cdf06, fixed test (port from 1.7)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3504
diff changeset
33 FootNote.execute(m, text)
3056
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
34 result = FootNote.emit_footnotes(m.request, m.request.formatter)
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
35 assert result.endswith('2</a>)</li></ol></div>')
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
36
b7914fb12243 macro.FootNote: bug fix for MoinMoinBugs/FootNoteNumbering (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
37 coverage_modules = ['MoinMoin.macro.FootNote']