Mercurial > moin > 1.9
changeset 2727:cc9590a900c2
fix tests
author | Thomas Waldmann <tw AT waldmann-edv DOT de> |
---|---|
date | Mon, 13 Aug 2007 01:06:37 +0200 |
parents | 6cb75379c073 |
children | 59b3d8b8971f |
files | MoinMoin/macro/_tests/test_ImageLink.py MoinMoin/parser/_tests/test_text_moin_wiki.py |
diffstat | 2 files changed, 6 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/macro/_tests/test_ImageLink.py Sun Aug 12 23:58:58 2007 +0200 +++ b/MoinMoin/macro/_tests/test_ImageLink.py Mon Aug 13 01:06:37 2007 +0200 @@ -7,7 +7,7 @@ @license: GNU GPL, see COPYING for details. """ import os -from MoinMoin import macro +from MoinMoin import macro, wikiutil from MoinMoin.logfile import eventlog from MoinMoin.Page import Page from MoinMoin.PageEditor import PageEditor @@ -58,7 +58,8 @@ """ macro ImageLink test: 'no args for ImageLink (ImageLink is executed on FrontPage) """ #self._createTestPage('This is an example to test a macro') result = self._test_macro('ImageLink', '') - expected = '<div class="message">Not enough arguments to ImageLink macro! e.g. <<ImageLink(example.png, WikiName, width=200)>>.</div>' + expected = '<div class="message">%s</div>' % wikiutil.escape( + 'Not enough arguments to ImageLink macro! e.g. <<ImageLink(example.png, WikiName, width=200)>>.') assert result == expected def testImageLinkTwoParamsNoKeyword(self):
--- a/MoinMoin/parser/_tests/test_text_moin_wiki.py Sun Aug 12 23:58:58 2007 +0200 +++ b/MoinMoin/parser/_tests/test_text_moin_wiki.py Mon Aug 13 01:06:37 2007 +0200 @@ -534,13 +534,9 @@ _tests = ( # test, expected ('[[something]]', '<a class="nonexistent" href="./something">something</a>'), - ("['something']", "['something']"), - ('MoinMoin:something', '<a class="interwiki" href="http://moinmoin.wikiwikiweb.de/something" title="MoinMoin">something</a>'), - ('[[MoinMoin:with space]]', '<a class="interwiki" href="http://moinmoin.wikiwikiweb.de/with%20space" title="MoinMoin">with space</a>'), - ('[[RFC:1 2 3]]', '<a class="interwiki" href="http://www.ietf.org/rfc/rfc1%202%203" title="RFC">1 2 3</a>'), - ("[[RFC:something else]]", "RFC:'something else'"), - ('[[with " quote]]', '<a class="nonexistent" href="./with%20%22%20quote">with " quote</a>'), - ('[[MoinMoin:with " quote]]', '<a class="interwiki" href="http://moinmoin.wikiwikiweb.de/with%20%22%20quote" title="MoinMoin">with " quote</a>'), + ('MoinMoin:something', '<a class="interwiki" href="http://moinmoin.wikiwikiweb.de/something" title="MoinMoin">something</a>'), + ('[[MoinMoin:with space]]', '<a class="interwiki" href="http://moinmoin.wikiwikiweb.de/with%20space" title="MoinMoin">with space</a>'), + ('[[RFC:1 2 3]]', '<a class="interwiki" href="http://www.ietf.org/rfc/rfc1%202%203" title="RFC">1 2 3</a>'), ) def testTextFormating(self): @@ -554,15 +550,6 @@ together_test.append(test) together_expected.append(expected) - # now test all together to make sure one quoting doesn't - # "leak" into the next - for joint in ('', 'lala " lala ', 'lala "" lala '): - test = joint.join(together_test) - expected = joint.join(together_expected) - html = self.parse(self.text % test) - result = self.needle.search(html).group(1) - assert result == expected - coverage_modules = ['MoinMoin.parser.text_moin_wiki']