incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [35/50] git commit: [#6534] ticket:442 added test for mediawiki converter
Date Fri, 04 Oct 2013 18:07:19 GMT
[#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/6692
Commit: f8a82e70deaaa83658feaae5f365bac597c0e761
Parents: acb0102
Author: coldmind <sokandpal@yandex.ru>
Authored: Tue Sep 24 17:12:55 2013 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
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'<a href="https://github/a/b/wiki/Test Page">Test <b>Page</b></a>',
prefix, new),
                      u'<a href="/p/test/wiki/Test Page">Test <b>Page</b></a>')
 
+    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):


Mime
View raw message