Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D1F6A1063A for ; Wed, 9 Oct 2013 12:48:27 +0000 (UTC) Received: (qmail 84577 invoked by uid 500); 9 Oct 2013 12:48:26 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 84272 invoked by uid 500); 9 Oct 2013 12:48:24 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 83296 invoked by uid 99); 9 Oct 2013 12:48:18 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Oct 2013 12:48:18 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 6A6AE8B2DCD; Wed, 9 Oct 2013 12:48:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org Date: Wed, 09 Oct 2013 12:48:36 -0000 Message-Id: <6986e4388b884f62bd2572c53e90f4b9@git.apache.org> In-Reply-To: <5cf9d53b735845b589bb2bac6e7f63b7@git.apache.org> References: <5cf9d53b735845b589bb2bac6e7f63b7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [20/50] git commit: [#6534] ticket:442 added test for mediawiki converter [#6534] ticket:442 added test for mediawiki converter Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/f8a82e70 Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f8a82e70 Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f8a82e70 Branch: refs/heads/cj/6422 Commit: f8a82e70deaaa83658feaae5f365bac597c0e761 Parents: acb0102 Author: coldmind Authored: Tue Sep 24 17:12:55 2013 +0300 Committer: Dave Brondsema Committed: Fri Oct 4 14:21:23 2013 +0000 ---------------------------------------------------------------------- .../forgeimporters/github/tests/test_wiki.py | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f8a82e70/ForgeImporters/forgeimporters/github/tests/test_wiki.py ---------------------------------------------------------------------- diff --git a/ForgeImporters/forgeimporters/github/tests/test_wiki.py b/ForgeImporters/forgeimporters/github/tests/test_wiki.py index 5ad3aed..0f6bf26 100644 --- a/ForgeImporters/forgeimporters/github/tests/test_wiki.py +++ b/ForgeImporters/forgeimporters/github/tests/test_wiki.py @@ -301,7 +301,38 @@ Our website is [[http://sf.net]]. assert_equal(f(u'Test Page', prefix, new), u'Test Page') + def test_convert_markup_with_mediawiki2markdown(self): + importer = GitHubWikiImporter() + importer.github_wiki_url = 'https://github.com/a/b/wiki' + importer.app = Mock() + importer.app.url = '/p/test/wiki/' + f = importer.convert_markup + source = u'''Look at [[this page|Some Page]] + +More info at: [[MoreInfo]] [[Even More Info]] + +Our website is [[http://sf.net]]. + +'[[Escaped Tag]] + +[External link to the wiki page](https://github.com/a/b/wiki/Page) + +[External link](https://github.com/a/b/issues/1)''' + + result = u'''Look at [this page](Some Page) + +More info at: [MoreInfo] [Even More Info] + +Our website is [[http://sf.net](http://sf.net)]. + +[[Escaped Tag]] + +[External link to the wiki page](https://github.com/a/b/wiki/Page) + +[External link](https://github.com/a/b/issues/1) +''' + assert_equal(f(source, 'test.md', 'md'), result) class TestGitHubWikiImportController(TestController, TestCase):