annotate MoinMoin/script/migration/_tests/test_conv160a_wiki.py @ 4630:b0319cfcb1bc

1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 18 Feb 2009 06:53:55 +0100
parents b120d9978144
children 3be35ace8aca
rev   line source
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
2 """
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
3 MoinMoin - tests of wiki content conversion
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
5 TODO:
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
6 * fix parser/converter anchor link handling
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
7 * emit a warning if we find some page name that was renamed as a macro argument?
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
8 * shall we support camelcase renaming?
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
9
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
10 Limitations of this converter:
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
11 * converter does not touch "pre sections", thus markup examples in {{{ }}}
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
12 or ` ` will have to get handled manually.
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
13 * converter does not touch macro arguments, they will have to get handled
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
14 manually
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
15 * converter does not touch CamelCase links (but there should be no need to do)
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
16
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
17 @copyright: 2007 MoinMoin:ThomasWaldmann
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
18 @license: GNU GPL, see COPYING for details.
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
19 """
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
20 import py
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
21 #py.test.skip("broken")
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
22
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
23 from MoinMoin.script.migration._conv160a_wiki import convert_wiki
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
24
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
25 class TestWikiConversion:
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
26 """ test the wiki markup conversion 1.6.0a -> 1.6.0 """
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
27 def test_absolute(self):
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
28 request = self.request
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
29 pagename = 'TestPage'
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
30 rename_some_page = {
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
31 ('PAGE', 'some_page'): 'some page',
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
32 }
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
33 rename_some_file = {
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
34 ('FILE', pagename, 'with_underscore'): 'without underscore',
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
35 ('FILE', pagename, 'with blank'): 'without_blank',
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
36 }
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
37
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
38 tests = [
4488
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
39 # attachment links
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
40 ("attachment:filename.ext", {}, "[[attachment:filename.ext]]"),
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
41 ("[attachment:'Filename.ext' Aliasname]", {}, "[[attachment:Filename.ext|Aliasname]]"),
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
42 ("[attachment:'Pagename/Filename.ext' Aliasname]", {}, "[[attachment:Pagename/Filename.ext|Aliasname]]"),
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
43 ("[attachment:'Pagename/Subpage/Filename.ext' Aliasname]", {}, "[[attachment:Pagename/Subpage/Filename.ext|Aliasname]]"),
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
44 ('[attachment:"Pagename/Subpage/File Name.ext" Aliasname]', {}, "[[attachment:Pagename/Subpage/File Name.ext|Aliasname]]"),
4490
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
45 ('[inline:text.txt]', {}, '{{attachment:text.txt}}'), # inline is now implied by {{...}}
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
46 ('[inline:image.jpg]', {}, '{{attachment:image.jpg}}'), # inline is now implied by {{...}}
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
47 ('[drawing:image]', {}, '{{drawing:image}}'),
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
48 ('[inline:text.txt foo]', {}, '{{attachment:text.txt|foo}}'), # inline is now implied by {{...}}
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
49 ('[inline:image.jpg foo]', {}, '{{attachment:image.jpg|foo}}'), # inline is now implied by {{...}}
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
50 ('[drawing:image foo]', {}, '{{drawing:image|foo}}'),
4489
a835ada897e0 1.6.0a mig script/converter: fix interwiki tests, cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4488
diff changeset
51
a835ada897e0 1.6.0a mig script/converter: fix interwiki tests, cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4488
diff changeset
52 # "nothing changed" checks (except markup)
a835ada897e0 1.6.0a mig script/converter: fix interwiki tests, cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4488
diff changeset
53 ('', {}, ''),
a835ada897e0 1.6.0a mig script/converter: fix interwiki tests, cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4488
diff changeset
54 ('CamelCase', {}, 'CamelCase'),
4488
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
55 ('["/Subpage"]', {}, "[[/Subpage]]"),
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
56 ('["Pagename/Subpage"]', {}, "[[Pagename/Subpage]]"),
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
57 ("['Pagename/Subpage' Aliasname]", {}, "[[Pagename/Subpage|Aliasname]]"),
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
58 ('["some page" somepage]', {}, '[[some page|somepage]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
59 ("['some page' somepage]", {}, '[[some page|somepage]]'),
4489
a835ada897e0 1.6.0a mig script/converter: fix interwiki tests, cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4488
diff changeset
60
a835ada897e0 1.6.0a mig script/converter: fix interwiki tests, cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4488
diff changeset
61 ('Doesnotexist:CamelCase', {}, 'Doesnotexist:CamelCase'),
a835ada897e0 1.6.0a mig script/converter: fix interwiki tests, cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4488
diff changeset
62 ('MoinMaster:CamelCase', {}, 'MoinMaster:CamelCase'),
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
63 ("MoinMaster:'some page'", {}, '[[MoinMaster:some page]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
64 ('MoinMaster:"some page"', {}, '[[MoinMaster:some page]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
65
4489
a835ada897e0 1.6.0a mig script/converter: fix interwiki tests, cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4488
diff changeset
66 ('[wiki:MoinMoin/FrontPage]', {}, 'MoinMoin:FrontPage'),
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
67 ('some_text', {}, 'some_text'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
68 ('["some_text"]', {}, '[[some_text]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
69 ('some_page', rename_some_page, 'some_page'), # not a link
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
70 ('{{{["some_page"]}}}', rename_some_page, '{{{["some_page"]}}}'), # not a link
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
71 ('`["some_page"]`', rename_some_page, '`["some_page"]`'), # not a link
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
72 ('["OtherPage/some_page"]', rename_some_page, '[[OtherPage/some_page]]'), # different link
4489
a835ada897e0 1.6.0a mig script/converter: fix interwiki tests, cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4488
diff changeset
73 ('MoinMaster:some_page', rename_some_page, 'MoinMaster:some_page'), # external link
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
74 ('http://some_server/some_page', rename_some_page, 'http://some_server/some_page'), # external link
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
75 ('[http://some_server/some_page]', rename_some_page, '[[http://some_server/some_page]]'), # external link
4489
a835ada897e0 1.6.0a mig script/converter: fix interwiki tests, cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4488
diff changeset
76 ('[http://some_server/some_page foo]', rename_some_page, '[[http://some_server/some_page|foo]]'), # external link
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
77 ('[#some_page]', rename_some_page, '[[#some_page]]'), # link to anchor that has same name
4488
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
78 ('[attachment:some_page.png]', rename_some_page, '[[attachment:some_page.png]]'), # att, not page
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
79 ('[attachment:some_page.png test picture]', rename_some_page, '[[attachment:some_page.png|test picture]]'), # att, not page
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
80
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
81 # page rename changes result
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
82 ('["some_page"]', rename_some_page, '[[some page]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
83 ('[:some_page]', rename_some_page, '[[some page]]'),
4488
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
84 ('[:some_page#anchor]', rename_some_page, '[[some page#anchor]]'),
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
85 ('[:some_page:]', rename_some_page, '[[some page]]'),
4488
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
86 ('[:some_page#anchor:]', rename_some_page, '[[some page#anchor]]'),
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
87 ('[:some_page:some text]', rename_some_page, '[[some page|some text]]'),
4488
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
88 ('[:some_page#anchor:some text]', rename_some_page, '[[some page#anchor|some text]]'),
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
89 ('Self:some_page', rename_some_page, '[[some page]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
90 ('wiki:Self:some_page', rename_some_page, '[[some page]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
91 ('[wiki:Self:some_page some text]', rename_some_page, '[[some page|some text]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
92 ('wiki:Self:some_page#some_anchor', rename_some_page, '[[some page#some_anchor]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
93
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
94 # other markup changes we do
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
95 ('[:other page]', {}, '[[other page]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
96 ('[:other page:]', {}, '[[other page]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
97 ('[:other page:other text]', {}, '[[other page|other text]]'),
4489
a835ada897e0 1.6.0a mig script/converter: fix interwiki tests, cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4488
diff changeset
98 ('Self:CamelCase', {}, 'CamelCase'),
a835ada897e0 1.6.0a mig script/converter: fix interwiki tests, cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4488
diff changeset
99 ('[wiki:WikiPedia:Lynx_%28web_browser%29 Lynx]', {}, '[[WikiPedia:Lynx_(web_browser)|Lynx]]'),
4488
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
100 ('[:Something:Something]', {}, '[[Something]]'), # optimize markup
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
101
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
102 # "nothing changed" checks
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
103 ('attachment:OtherPage/with_underscore', rename_some_file, '[[attachment:OtherPage/with_underscore]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
104
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
105 # file rename changes result
4488
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
106 ('attachment:with_underscore', rename_some_file, '[[attachment:without underscore]]'),
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
107 ('attachment:TestPage/with_underscore', rename_some_file, '[[attachment:without underscore]]'), # remove superfluous pagename
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
108
4488
a2a05ae3e7ec 1.6.0a mig script/converter: add tests, improve test compliance, clean up
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3925
diff changeset
109 # embed images, all verified on 160a
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
110 ('http://server/image.png', {}, '{{http://server/image.png}}'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
111 ('attachment:image.gif', {}, '{{attachment:image.gif}}'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
112 ('inline:image.jpg', {}, '{{attachment:image.jpg}}'), # inline is now implied by {{...}}
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
113 ('drawing:image', {}, '{{drawing:image}}'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
114
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
115 # macros
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
116 ('[[BR]]', {}, '<<BR>>'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
117 ('[[FullSearch(wtf)]]', {}, '<<FullSearch(wtf)>>'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
118 (u'[[ImageLink(töst.png)]]', {}, u'[[attachment:töst.png|{{attachment:töst.png}}]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
119 ('[[ImageLink(test.png,OtherPage)]]', {}, '[[OtherPage|{{attachment:test.png}}]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
120 ('[[ImageLink(test.png,OtherPage,width=123,height=456)]]', {}, '[[OtherPage|{{attachment:test.png||width=123, height=456}}]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
121 ('[[ImageLink(test.png,OtherPage,width=123,height=456,alt=alttext)]]', {}, '[[OtherPage|{{attachment:test.png|alttext|width=123, height=456}}]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
122 ('[[ImageLink(test.png,OtherPage,width=123,height=456,alt=alt text with blanks)]]', {}, '[[OtherPage|{{attachment:test.png|alt text with blanks|width=123, height=456}}]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
123 ('[[ImageLink(http://server/test.png,OtherPage,width=123,height=456)]]', {}, '[[OtherPage|{{http://server/test.png||width=123, height=456}}]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
124 ('[[ImageLink(http://server/test.png,http://server/,width=123)]]', {}, '[[http://server/|{{http://server/test.png||width=123}}]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
125 ('[[ImageLink(test.png,attachment:test.png)]]', {}, '[[attachment:test.png|{{attachment:test.png}}]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
126 ('[[ImageLink(test.png,inline:test.py)]]', {}, '[[attachment:test.py|{{attachment:test.png}}]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
127
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
128 ]
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
129 for data, renames, expected in tests:
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
130 assert convert_wiki(request, pagename, data, renames) == expected
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
131
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
132 def test_sisterpage(self):
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
133 request = self.request
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
134 top_page = 'toppage'
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
135 pagename = '%s/subpage' % top_page
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
136 rename_some_page = {
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
137 ('PAGE', '%s/sister' % top_page): '%s/renamed_sister' % top_page,
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
138 }
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
139 tests = [
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
140 # "nothing changed" checks
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
141 ('["../sister_norename"]', rename_some_page, '[[../sister_norename]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
142
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
143 # renames
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
144 ('["../sister"]', rename_some_page, '[[../renamed_sister]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
145 ]
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
146 for data, renames, expected in tests:
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
147 assert convert_wiki(request, pagename, data, renames) == expected
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
148
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
149 def test_subpage(self):
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
150 request = self.request
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
151 pagename = 'toppage'
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
152 rename_some_page = {
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
153 ('PAGE', '%s/subpage' % pagename): '%s/renamed_subpage' % pagename,
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
154 }
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
155 tests = [
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
156 # "nothing changed" checks
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
157 ('["/subpage_norename"]', rename_some_page, '[[/subpage_norename]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
158
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
159 # renames
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
160 ('["/subpage"]', rename_some_page, '[[/renamed_subpage]]'),
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
161 ]
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
162 for data, renames, expected in tests:
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
163 assert convert_wiki(request, pagename, data, renames) == expected
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
164
4490
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
165 def test_full_page(self):
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
166 #py.test.skip("not wanted right now")
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
167 markup_160a = u"""\
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
168 = CamelCase =
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
169 == Pages ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
170 1. SomePage
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
171 2. TestPage (does not link to current page)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
172 3. SomePage/SubPage
3925
44d856f8a110 add migration support to migrate from early 1.6.0alpha to 1.6.0 release
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
173
4490
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
174 ## not supported on 160a
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
175 ##== Pages with anchor ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
176 ## 1. SomePage#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
177 ## 2. TestPage#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
178 ## 3. SomePage/SubPage#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
179
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
180 = Interwiki =
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
181 == Pages ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
182 1. Self:SomePage
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
183 2. Self:some_page
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
184 3. Self:'some page'
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
185 4. Self:"some page"
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
186 5. MoinMoin:SomePage
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
187 6. MoinMoin:some_page
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
188 7. MoinMoin:'some page'
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
189 8. MoinMoin:"some page"
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
190
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
191 == Pages with anchor ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
192 1. Self:SomePage#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
193 2. Self:some_page#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
194 3. Self:'some page#anchor'
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
195 4. Self:"some page#anchor"
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
196 5. MoinMoin:SomePage#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
197 6. MoinMoin:some_page#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
198 7. MoinMoin:'some page#anchor'
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
199 8. MoinMoin:"some page#anchor"
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
200
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
201 == Invalid wiki name ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
202 1. Doesnotexist:CamelCase (shall not link)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
203 2. Foo:bar (shall not link)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
204
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
205 = URL =
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
206 == simple ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
207 1. http://moinmo.in/MoinMoin
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
208 2. http://static.moinmo.in/logos/moinmoin.png (renders image in 160a)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
209 3. mailto:someone@example.org
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
210 4. wiki:Self:some_page
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
211
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
212 == with anchor ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
213 1. http://moinmo.in/MoinMoin#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
214 2. wiki:Self:some_page#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
215
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
216 = bracketed link =
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
217 == Page ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
218 1. ["some page"]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
219 2. ["some page" somepage]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
220 3. ['some page' somepage]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
221 4. ["/Subpage"]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
222 5. ["SomePage/Subpage"]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
223 6. ['SomePage/Subpage' Some Page]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
224
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
225 == Page with anchor ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
226 1. ["some page#anchor"]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
227 2. ["some page#anchor" somepage]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
228 3. ['some page#anchor' somepage]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
229 4. ["/Subpage#anchor"]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
230 5. ["SomePage/Subpage#anchor"]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
231 6. ['SomePage/Subpage#anchor' Some Page]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
232
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
233 == Anchor on current page ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
234 1. [#anchor]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
235 ## 1. [TestPage#anchor] not supported on 160a
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
236
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
237 == URL ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
238 1. [http://some_server/some_page]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
239 2. [http://some_server/some_page some page]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
240 3. [wiki:MoinMoin/FrontPage]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
241 4. [wiki:Self:some_page some page]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
242 5. [wiki:WikiPedia:Lynx_(web_browser) Lynx]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
243 6. [:some_page]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
244 7. [:some_page:]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
245 8. [:some_page:some page]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
246 9. [:Something:Something]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
247
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
248 == URL with anchor ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
249 1. [http://some_server/some_page#anchor]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
250 2. [http://some_server/some_page#anchor some page]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
251 3. [wiki:MoinMoin/FrontPage#anchor]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
252 4. [wiki:Self:some_page#anchor some page]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
253 5. [wiki:WikiPedia:Lynx_(web_browser)#anchor Lynx]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
254 6. [:some_page#anchor]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
255 7. [:some_page#anchor:]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
256 8. [:some_page#anchor:some page]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
257 9. [:Something#anchor:Something]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
258
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
259 = preformatted =
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
260 1. {{{["some_page"]}}} (converter shall not change pre content)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
261 2. `["some_page"]` (converter shall not change pre content)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
262
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
263 = Attachments, Drawings, Images =
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
264 == simple ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
265 1. attachment:text.txt is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
266 2. inline:text.txt is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
267 3. attachment:image.png is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
268 4. inline:image.png is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
269 5. drawing:image is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
270
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
271 == bracketed ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
272 1. [attachment:text.txt] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
273 2. [inline:text.txt] is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
274 3. [attachment:image.png] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
275 4. [drawing:image] is embedding png image
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
276 5. [inline:image.png] is showing binary content as text in 160a (wrong)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
277
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
278 == bracketed with label ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
279 1. [attachment:text.txt some label] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
280 2. [inline:text.txt some label] is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
281 3. [attachment:image.png some label] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
282 4. [drawing:image some label] is embedding png image
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
283 5. [inline:image.png some label] is showing binary content as text in 160a (wrong)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
284
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
285 == bracketed, on other page, with label ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
286 1. [attachment:SomePage/text.txt some label] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
287 2. [inline:SomePage/text.txt some label] is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
288 3. [attachment:SomePage/image.png some label] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
289 4. [drawing:SomePage/image some label] is embedding png image
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
290 5. [inline:SomePage/image.png some label] is showing binary content as text in 160a (wrong)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
291
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
292 """
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
293 expected_markup_160 = u"""\
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
294 = CamelCase =
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
295 == Pages ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
296 1. SomePage
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
297 2. TestPage (does not link to current page)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
298 3. [[SomePage/SubPage]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
299
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
300 ## not supported on 160a
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
301 ##== Pages with anchor ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
302 ## 1. SomePage#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
303 ## 2. TestPage#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
304 ## 3. SomePage/SubPage#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
305
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
306 = Interwiki =
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
307 == Pages ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
308 1. SomePage
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
309 2. [[some_page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
310 3. [[some page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
311 4. [[some page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
312 5. MoinMoin:SomePage
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
313 6. MoinMoin:some_page
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
314 7. [[MoinMoin:some page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
315 8. [[MoinMoin:some page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
316
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
317 == Pages with anchor ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
318 1. [[SomePage#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
319 2. [[some_page#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
320 3. [[some page#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
321 4. [[some page#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
322 5. MoinMoin:SomePage#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
323 6. MoinMoin:some_page#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
324 7. [[MoinMoin:some page#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
325 8. [[MoinMoin:some page#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
326
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
327 == Invalid wiki name ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
328 1. Doesnotexist:CamelCase (shall not link)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
329 2. Foo:bar (shall not link)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
330
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
331 = URL =
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
332 == simple ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
333 1. http://moinmo.in/MoinMoin
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
334 2. {{http://static.moinmo.in/logos/moinmoin.png}} (renders image in 160a)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
335 3. mailto:someone@example.org
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
336 4. [[some_page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
337
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
338 == with anchor ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
339 1. http://moinmo.in/MoinMoin#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
340 2. [[some_page#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
341
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
342 = bracketed link =
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
343 == Page ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
344 1. [[some page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
345 2. [[some page|somepage]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
346 3. [[some page|somepage]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
347 4. [[/Subpage]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
348 5. [[SomePage/Subpage]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
349 6. [[SomePage/Subpage|Some Page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
350
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
351 == Page with anchor ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
352 1. [[some page#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
353 2. [[some page#anchor|somepage]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
354 3. [[some page#anchor|somepage]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
355 4. [[/Subpage#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
356 5. [[SomePage/Subpage#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
357 6. [[SomePage/Subpage#anchor|Some Page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
358
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
359 == Anchor on current page ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
360 1. [[#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
361 ## 1. [TestPage#anchor] not supported on 160a
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
362
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
363 == URL ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
364 1. [[http://some_server/some_page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
365 2. [[http://some_server/some_page|some page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
366 3. MoinMoin:FrontPage
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
367 4. [[some_page|some page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
368 5. [[WikiPedia:Lynx_(web_browser)|Lynx]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
369 6. [[some_page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
370 7. [[some_page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
371 8. [[some_page|some page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
372 9. [[Something]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
373
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
374 == URL with anchor ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
375 1. [[http://some_server/some_page#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
376 2. [[http://some_server/some_page#anchor|some page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
377 3. MoinMoin:FrontPage#anchor
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
378 4. [[some_page#anchor|some page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
379 5. [[WikiPedia:Lynx_(web_browser)#anchor|Lynx]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
380 6. [[some_page#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
381 7. [[some_page#anchor]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
382 8. [[some_page#anchor|some page]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
383 9. [[Something#anchor|Something]]
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
384
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
385 = preformatted =
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
386 1. {{{["some_page"]}}} (converter shall not change pre content)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
387 2. `["some_page"]` (converter shall not change pre content)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
388
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
389 = Attachments, Drawings, Images =
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
390 == simple ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
391 1. [[attachment:text.txt]] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
392 2. {{attachment:text.txt}} is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
393 3. {{attachment:image.png}} is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
394 4. {{attachment:image.png}} is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
395 5. {{drawing:image}} is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
396
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
397 == bracketed ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
398 1. [[attachment:text.txt]] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
399 2. {{attachment:text.txt}} is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
400 3. [[attachment:image.png]] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
401 4. {{drawing:image}} is embedding png image
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
402 5. {{attachment:image.png}} is showing binary content as text in 160a (wrong)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
403
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
404 == bracketed with label ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
405 1. [[attachment:text.txt|some label]] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
406 2. {{attachment:text.txt|some label}} is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
407 3. [[attachment:image.png|some label]] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
408 4. {{drawing:image|some label}} is embedding png image
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
409 5. {{attachment:image.png|some label}} is showing binary content as text in 160a (wrong)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
410
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
411 == bracketed, on other page, with label ==
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
412 1. [[attachment:SomePage/text.txt|some label]] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
413 2. {{attachment:SomePage/text.txt|some label}} is embedding
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
414 3. [[attachment:SomePage/image.png|some label]] is linking
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
415 4. {{drawing:SomePage/image|some label}} is embedding png image
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
416 5. {{attachment:SomePage/image.png|some label}} is showing binary content as text in 160a (wrong)
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
417
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
418 """
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
419 markup_160 = convert_wiki(self.request, u'TestPage', markup_160a, {})
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
420 #print markup_160a ; print "---" ; print markup_160
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
421 markup_160 = markup_160.replace('\r\n', '\n')
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
422 assert markup_160 == expected_markup_160
b120d9978144 1.6.0a mig script/converter: fixed inline/drawing conversion, added more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4489
diff changeset
423
4630
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
424 def test_parser(self):
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
425 markup_160a = u"""\
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
426 {{{#!html
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
427 ...
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
428 }}}
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
429
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
430 """
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
431 expected_markup_160 = u"""\
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
432 {{{#!html
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
433 ...
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
434 }}}
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
435
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
436 """
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
437 markup_160 = convert_wiki(self.request, u'TestPage', markup_160a, {})
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
438 #print markup_160a ; print "---" ; print markup_160
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
439 markup_160 = markup_160.replace('\r\n', '\n')
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
440 assert markup_160 == expected_markup_160
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
441
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
442 def test_pre(self):
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
443 markup_160a = u"""\
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
444 {{{
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
445 ...
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
446 }}}
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
447
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
448 """
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
449 expected_markup_160 = u"""\
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
450 {{{
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
451 ...
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
452 }}}
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
453
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
454 """
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
455 markup_160 = convert_wiki(self.request, u'TestPage', markup_160a, {})
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
456 #print markup_160a ; print "---" ; print markup_160
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
457 markup_160 = markup_160.replace('\r\n', '\n')
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
458 assert markup_160 == expected_markup_160
b0319cfcb1bc 1.6.0a mig script/converter: fixed converter bug for parser sections, added unit tests for pre and parser sections
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4490
diff changeset
459