changeset 2606:482f0a9e555c

1.6 converter: add more tests, TODO, fixed sourcecode test failure
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 05 Aug 2007 14:47:10 +0200
parents a12f848eee3c
children 2e6227a50d27
files MoinMoin/script/migration/_conv160_wiki.py MoinMoin/script/migration/_tests/test_conv160_wiki.py
diffstat 2 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/script/migration/_conv160_wiki.py	Sun Aug 05 01:36:00 2007 +0200
+++ b/MoinMoin/script/migration/_conv160_wiki.py	Sun Aug 05 14:47:10 2007 +0200
@@ -26,7 +26,7 @@
 
 import re, codecs
 from MoinMoin import i18n
-i18n.wikiLanguages = lambda : []
+i18n.wikiLanguages = lambda: []
 from MoinMoin import config, wikiutil
 from MoinMoin.parser.text_moin_wiki import Parser
 from MoinMoin.action import AttachFile
--- a/MoinMoin/script/migration/_tests/test_conv160_wiki.py	Sun Aug 05 01:36:00 2007 +0200
+++ b/MoinMoin/script/migration/_tests/test_conv160_wiki.py	Sun Aug 05 14:47:10 2007 +0200
@@ -2,6 +2,13 @@
 """
     MoinMoin - tests of wiki content conversion
 
+    TODO:
+    * add some ../some_page test
+    * add some /some_page test
+    * fix parser/converter anchor link handling
+    * emit a warning if we find some page name that was renamed as a macro argument
+    * shall we support camelcase renaming?
+
     @copyright: 2007 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
@@ -12,19 +19,30 @@
     pagename = 'TestPage'
     rename_some_page = {
             ('PAGE', 'some_page'): 'some page',
+            # NEEDED? ('PAGE', 'RenameThis'): 'ThisRenamed',
     }
     rename_some_file = {
             ('FILE', pagename, 'with_underscore'): 'without underscore',
             ('FILE', pagename, 'with blank'): 'without_blank',
     }
     tests = [
+        # NEEDED? ('CamelCase', {}, 'CamelCase'),
+        # FAILS ('RenameThis', rename_some_page, 'ThisRenamed'),
+        # NEEDED? ('!RenameThis', {}, '!RenameThis'), # not a link
+
         # "nothing changed" checks
         ('', {}, ''),
-        ('CamelCase', {}, 'CamelCase'),
         ('MoinMaster:CamelCase', {}, 'MoinMaster:CamelCase'),
         ('some_text', {}, 'some_text'),
         ('["some_text"]', {}, '["some_text"]'),
         ('some_page', rename_some_page, 'some_page'), # not a link
+        ('{{{["some_page"]}}}', rename_some_page, '{{{["some_page"]}}}'), # not a link
+        ('`["some_page"]`', rename_some_page, '`["some_page"]`'), # not a link
+        ('["OtherPage/some_page"]', rename_some_page, '["OtherPage/some_page"]'), # different link
+        ('MoinMaster:some_page', rename_some_page, 'MoinMaster:some_page'), # external link
+        ('http://some_server/some_page', rename_some_page, 'http://some_server/some_page'), # external link
+        ('[http://some_server/some_page]', rename_some_page, '[http://some_server/some_page]'), # external link
+        ('[#some_page]', rename_some_page, '[#some_page]'), # link to anchor that has same name
 
         # page rename changes result
         ('["some_page"]', rename_some_page, '["some page"]'),
@@ -33,6 +51,7 @@
         ('[:some_page:some text]', rename_some_page, '["some page" some text]'),
         ('Self:some_page', rename_some_page, '["some page"]'),
         ('wiki:Self:some_page', rename_some_page, '["some page"]'),
+        # XXX FAILS ('wiki:Self:some_page#some_anchor', rename_some_page, '["some page"#some_anchor]'),
         ('[wiki:Self:some_page]', rename_some_page, '["some page"]'),
         ('[wiki:Self:some_page some text]', rename_some_page, '["some page" some text]'),