comparison MoinMoin/script/migration/_tests/test_conv160_wiki.py @ 2612:e3e5e2373c60

1.6 converter: cleanup link conversion, cleanup/add tests
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 08 Aug 2007 03:53:46 +0200
parents 7ed38f2af242
children 9a17fabb8008 61efafeafed5
comparison
equal deleted inserted replaced
2611:7ed38f2af242 2612:e3e5e2373c60
26 def test_absolute(self): 26 def test_absolute(self):
27 request = self.request 27 request = self.request
28 pagename = 'TestPage' 28 pagename = 'TestPage'
29 rename_some_page = { 29 rename_some_page = {
30 ('PAGE', 'some_page'): 'some page', 30 ('PAGE', 'some_page'): 'some page',
31 # NEEDED? ('PAGE', 'RenameThis'): 'ThisRenamed',
32 } 31 }
33 rename_some_file = { 32 rename_some_file = {
34 ('FILE', pagename, 'with_underscore'): 'without underscore', 33 ('FILE', pagename, 'with_underscore'): 'without underscore',
35 ('FILE', pagename, 'with blank'): 'without_blank', 34 ('FILE', pagename, 'with blank'): 'without_blank',
36 } 35 }
36
37 tests = [ 37 tests = [
38 # NEEDED? ('CamelCase', {}, 'CamelCase'),
39 # FAILS ('RenameThis', rename_some_page, 'ThisRenamed'),
40 # NEEDED? ('!RenameThis', {}, '!RenameThis'), # not a link
41
42 # FAILING tests: 38 # FAILING tests:
43 #('[wiki:/OtherPage]', rename_some_page, '[wiki:/OtherPage]'), 39 #('[wiki:/OtherPage]', rename_some_page, '[wiki:/OtherPage]'),
44 #('[wiki:/OtherPage other page]', rename_some_page, '[wiki:/OtherPage other page]'), 40 #('[wiki:/OtherPage other page]', rename_some_page, '[wiki:/OtherPage other page]'),
45 # ('[:Something:Something]', {}, '["Something"]'),
46 #('[attachment:My%20Attachment.jpg:it works]', {}, '[attachment:"My Attachment.jpg" it works]'), 41 #('[attachment:My%20Attachment.jpg:it works]', {}, '[attachment:"My Attachment.jpg" it works]'),
47 #('[wiki:LinuxWiki: LinuxWiki.de]', {}, '[wiki:LinuxWiki: LinuxWiki.de]'), 42 #('[wiki:LinuxWiki: LinuxWiki.de]', {}, '[wiki:LinuxWiki: LinuxWiki.de]'),
48 #('[:MeatBall:CleanLinking meatball-wiki: clean linking]', {}, '[:MeatBall:CleanLinking meatball-wiki: clean linking]'), 43 #('[:MeatBall:CleanLinking meatball-wiki: clean linking]', {}, '[:MeatBall:CleanLinking meatball-wiki: clean linking]'),
49 44
50 # ambiguity!!! can be resolved with some interwiki map lookup 45 # ambiguity!!! can be resolved with some interwiki map lookup
53 #('[wiki:MacroMarket/EmbedObject EO]', {}, '["MacroMarket/EmbedObject" EO]'), 48 #('[wiki:MacroMarket/EmbedObject EO]', {}, '["MacroMarket/EmbedObject" EO]'),
54 ('[wiki:SeaPig/BrianDorsey]', {}, '[wiki:SeaPig:BrianDorsey]'), 49 ('[wiki:SeaPig/BrianDorsey]', {}, '[wiki:SeaPig:BrianDorsey]'),
55 50
56 # "nothing changed" checks 51 # "nothing changed" checks
57 ('', {}, ''), 52 ('', {}, ''),
53 ('CamelCase', {}, 'CamelCase'),
58 ('MoinMaster:CamelCase', {}, 'MoinMaster:CamelCase'), 54 ('MoinMaster:CamelCase', {}, 'MoinMaster:CamelCase'),
59 ('some_text', {}, 'some_text'), 55 ('some_text', {}, 'some_text'),
60 ('["some_text"]', {}, '["some_text"]'), 56 ('["some_text"]', {}, '["some_text"]'),
61 ('some_page', rename_some_page, 'some_page'), # not a link 57 ('some_page', rename_some_page, 'some_page'), # not a link
62 ('{{{["some_page"]}}}', rename_some_page, '{{{["some_page"]}}}'), # not a link 58 ('{{{["some_page"]}}}', rename_some_page, '{{{["some_page"]}}}'), # not a link
84 ('[:other page]', {}, '["other page"]'), 80 ('[:other page]', {}, '["other page"]'),
85 ('[:other page:]', {}, '["other page"]'), 81 ('[:other page:]', {}, '["other page"]'),
86 ('[:other page:other text]', {}, '["other page" other text]'), 82 ('[:other page:other text]', {}, '["other page" other text]'),
87 # FAILS ('Self:CamelCase', {}, 'CamelCase'), 83 # FAILS ('Self:CamelCase', {}, 'CamelCase'),
88 ('[wiki:WikiPedia:Lynx_%28web_browser%29 Lynx]', {}, '[wiki:WikiPedia:"Lynx_(web_browser)" Lynx]'), 84 ('[wiki:WikiPedia:Lynx_%28web_browser%29 Lynx]', {}, '[wiki:WikiPedia:"Lynx_(web_browser)" Lynx]'),
85 ('[:Something:Something]', {}, '["Something"]'), # optimize markup
89 86
90 # "nothing changed" checks 87 # "nothing changed" checks
91 ('attachment:OtherPage/with_underscore', rename_some_file, 'attachment:OtherPage/with_underscore'), 88 ('attachment:OtherPage/with_underscore', rename_some_file, 'attachment:OtherPage/with_underscore'),
92 89
93 # file rename changes result 90 # file rename changes result