~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to MoinMoin/script/migration/_tests/test_conv160_wiki.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
Import upstream version 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import py
22
22
#py.test.skip("broken")
23
23
 
24
 
from MoinMoin import i18n
25
 
i18n_wikiLanguages = i18n.wikiLanguages
26
 
# convert_wiki overwrites i18n.wikiLanguages, we revert this change for following tests
27
24
from MoinMoin.script.migration._conv160_wiki import convert_wiki
28
 
i18n.wikiLanguages = i18n_wikiLanguages
29
25
 
30
26
class TestWikiConversion:
31
27
    """ test the wiki markup conversion 1.5.8 -> 1.6.0 """
115
111
            # macros
116
112
            ('[[BR]]', {}, '<<BR>>'),
117
113
            ('[[FullSearch(wtf)]]', {}, '<<FullSearch(wtf)>>'),
118
 
            (u'[[ImageLink(töst.png)]]', {}, u'[[attachment:töst.png|{{attachment:töst.png}}]]'),
 
114
            (u'[[ImageLink(t�st.png)]]', {}, u'[[attachment:t�st.png|{{attachment:t�st.png}}]]'),
119
115
            ('[[ImageLink(test.png,OtherPage)]]', {}, '[[OtherPage|{{attachment:test.png}}]]'),
120
116
            ('[[ImageLink(test.png,OtherPage,width=123,height=456)]]', {}, '[[OtherPage|{{attachment:test.png||width=123, height=456}}]]'),
121
117
            ('[[ImageLink(test.png,OtherPage,width=123,height=456,alt=alttext)]]', {}, '[[OtherPage|{{attachment:test.png|alttext|width=123, height=456}}]]'),
162
158
        for data, renames, expected in tests:
163
159
            assert convert_wiki(request, pagename, data, renames) == expected
164
160
 
165
 
    def test_parser(self):
166
 
        #py.test.skip("not wanted right now")
167
 
        markup_15 = u"""\
168
 
{{{#!html
169
 
...
170
 
}}}
171
 
 
172
 
"""
173
 
        expected_markup_160 = u"""\
174
 
{{{#!html
175
 
...
176
 
}}}
177
 
 
178
 
"""
179
 
        markup_160 = convert_wiki(self.request, u'TestPage', markup_15, {})
180
 
        #print markup_15 ; print "---" ; print markup_160
181
 
        markup_160 = markup_160.replace('\r\n', '\n')
182
 
        assert markup_160 == expected_markup_160
183
 
 
184
 
 
185
 
    def test_pre(self):
186
 
        #py.test.skip("not wanted right now")
187
 
        markup_15 = u"""\
188
 
{{{
189
 
...
190
 
}}}
191
 
 
192
 
"""
193
 
        expected_markup_160 = u"""\
194
 
{{{
195
 
...
196
 
}}}
197
 
 
198
 
"""
199
 
        markup_160 = convert_wiki(self.request, u'TestPage', markup_15, {})
200
 
        #print markup_15 ; print "---" ; print markup_160
201
 
        markup_160 = markup_160.replace('\r\n', '\n')
202
 
        assert markup_160 == expected_markup_160
203
161