本文整理汇总了Python中forgeimporters.github.wiki.GitHubWikiImporter.github_wiki_url方法的典型用法代码示例。如果您正苦于以下问题:Python GitHubWikiImporter.github_wiki_url方法的具体用法?Python GitHubWikiImporter.github_wiki_url怎么用?Python GitHubWikiImporter.github_wiki_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类forgeimporters.github.wiki.GitHubWikiImporter
的用法示例。
在下文中一共展示了GitHubWikiImporter.github_wiki_url方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_convert_markup_with_mediawiki2markdown
# 需要导入模块: from forgeimporters.github.wiki import GitHubWikiImporter [as 别名]
# 或者: from forgeimporters.github.wiki.GitHubWikiImporter import github_wiki_url [as 别名]
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'''
''Al'fredas 235 BC''
== See also ==
* [https://github.com/a/b/wiki/AgentSpring-running-instructions-for-d13n-model Test1]
* [https://github.com/a/b/wiki/AgentSpring-conventions Test2]
* [https://github.com/a/b/wiki/AgentSpring-Q&A Test3]
* [https://github.com/a/b/wiki/Extensions Test4]'''
result = u'''_Al'fredas 235 BC_
## See also
* [Test1](/p/test/wiki/AgentSpring running instructions for d13n model)
* [Test2](/p/test/wiki/AgentSpring conventions)
* [Test3](/p/test/wiki/AgentSpring Q&A)
* [Test4](/p/test/wiki/Extensions)
'''
assert_equal(f(source, 'test.mediawiki'), result)
示例2: test_convert_markup_without_html2text
# 需要导入模块: from forgeimporters.github.wiki import GitHubWikiImporter [as 别名]
# 或者: from forgeimporters.github.wiki.GitHubWikiImporter import github_wiki_url [as 别名]
def test_convert_markup_without_html2text(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'''<p>Look at [[this page|Some Page]]</p>
<p>More info at: [[MoreInfo]] [[Even More Info]]</p>
<p>Our website is [[http://sf.net]].</p>
<p>'[[Escaped Tag]]</p>
<p>[External link to the wiki page](https://github.com/a/b/wiki/Page)</p>
<p>[External link](https://github.com/a/b/issues/1)</p>'''
assert_equal(f(source, 'test.textile').strip(), result)
示例3: test_convert_textile_special_tag
# 需要导入模块: from forgeimporters.github.wiki import GitHubWikiImporter [as 别名]
# 或者: from forgeimporters.github.wiki.GitHubWikiImporter import github_wiki_url [as 别名]
def test_convert_textile_special_tag(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'*[[this checklist|Troubleshooting]]*'
assert_equal(f(source, 't.textile').strip(), u'**[this checklist](Troubleshooting)**')
示例4: test_convert_textile_special_tag_without_html2text
# 需要导入模块: from forgeimporters.github.wiki import GitHubWikiImporter [as 别名]
# 或者: from forgeimporters.github.wiki.GitHubWikiImporter import github_wiki_url [as 别名]
def test_convert_textile_special_tag_without_html2text(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'*[[this checklist|Troubleshooting]]*'
result = u'<p><strong>[[this checklist|Troubleshooting]]</strong></p>'
assert_equal(f(source, 't.textile').strip(), result)
示例5: test_convert_markup_with_amp_in_links
# 需要导入模块: from forgeimporters.github.wiki import GitHubWikiImporter [as 别名]
# 或者: from forgeimporters.github.wiki.GitHubWikiImporter import github_wiki_url [as 别名]
def test_convert_markup_with_amp_in_links(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'[[Ticks & Leeches]]'
result = u'[Ticks & Leeches]'
# markdown should be untouched
assert_equal(f(source, 'test.rst').strip(), result)
示例6: test_with_history
# 需要导入模块: from forgeimporters.github.wiki import GitHubWikiImporter [as 别名]
# 或者: from forgeimporters.github.wiki.GitHubWikiImporter import github_wiki_url [as 别名]
def test_with_history(self, render, upsert):
self.commit2.stats.files = {"Home.rst": self.blob1}
self.commit2.tree = {"Home.rst": self.blob1}
importer = GitHubWikiImporter()
importer._set_available_pages = Mock()
importer.github_wiki_url = 'https://github.com/a/b/wiki'
importer.app = Mock()
importer.app.config.options = {}
importer.app.url = '/p/test/wiki/'
importer.rewrite_links = Mock(return_value='')
importer._with_history(self.commit2)
assert_equal(upsert.call_args_list, [call('Home')])
assert_equal(render.call_args_list, [call('Home.rst', u'# test message')])
示例7: test_without_history
# 需要导入模块: from forgeimporters.github.wiki import GitHubWikiImporter [as 别名]
# 或者: from forgeimporters.github.wiki.GitHubWikiImporter import github_wiki_url [as 别名]
def test_without_history(self, render, upsert):
self.commit2.tree.blobs = [self.blob2, self.blob3]
upsert.text = Mock()
importer = GitHubWikiImporter()
importer.github_wiki_url = 'https://github.com/a/b/wiki'
importer.app = Mock()
importer.app.config.options = {}
importer.app.url = '/p/test/wiki/'
importer.rewrite_links = Mock(return_value='')
importer._without_history(self.commit2)
assert_equal(upsert.call_args_list, [call('Home2'), call('Home3')])
assert_equal(render.call_args_list, [
call('Home2.creole', u'**test message**'),
call('Home3.rest', u'test message')])
示例8: test_convert_markup
# 需要导入模块: from forgeimporters.github.wiki import GitHubWikiImporter [as 别名]
# 或者: from forgeimporters.github.wiki.GitHubWikiImporter import github_wiki_url [as 别名]
def test_convert_markup(self):
importer = GitHubWikiImporter()
importer.github_wiki_url = 'https://github.com/a/b/wiki'
importer.app = Mock()
importer.app.url = '/p/test/wiki/'
importer.github_markdown_converter = GitHubMarkdownConverter(
'user', 'proj')
f = importer.convert_markup
source = u'''Look at [[this page|Some Page]]
More info at: [[MoreInfo]] [[Even More Info]]
Our website is [[http://domain.net]].
'[[Escaped Tag]]
```python
codeblock
```
ticket #1
#1 header
sha aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'''
result = u'''Look at [this page](Some Page)
More info at: [MoreInfo] [Even More Info]
Our website is <http://domain.net>.
[[Escaped Tag]]
:::python
codeblock
ticket [#1]
[#1] header
sha [aaaaaa]'''
assert_equal(f(source, 'test.md').strip(), result)
assert_equal(f(u'h1. Hello', 't.textile').strip(), u'# Hello')
示例9: test_convert_markup_textile
# 需要导入模块: from forgeimporters.github.wiki import GitHubWikiImporter [as 别名]
# 或者: from forgeimporters.github.wiki.GitHubWikiImporter import github_wiki_url [as 别名]
def test_convert_markup_textile(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
# check if lists converting works properly
source = u'''There are good reasons for this:
# Duplicate libraries regularly break builds
# Subtle bugs emerge with duplicate libraries, and to a lesser extent, duplicate tools
# We want you to try harder to make your formula work with what OS X comes with
'''
result = u'''There are good reasons for this:
1. Duplicate libraries regularly break builds
2. Subtle bugs emerge with duplicate libraries, and to a lesser extent, duplicate tools
3. We want you to try harder to make your formula work with what OS X comes with
'''
assert_equal(f(source, 'test.textile'), result)
# textile-style links converts normal
source = '*"Textile":Troubleshooting*'
result = '**[Textile](Troubleshooting)**\n'
assert_equal(f(source, 'test2.textile'), result)
# links with formatting converts normal in textile now
source = u'''*[[this checklist|Troubleshooting]]*
some text and *[[Tips n' Tricks]]*
*[[link|http://otherlink.com]]*
'''
result = u'''**[this checklist](Troubleshooting)**
some text and **[Tips n' Tricks]**
**[link](http://otherlink.com)**
'''
assert_equal(f(source, 'test3.textile'), result)
示例10: test_convert_textile_no_leading_tabs
# 需要导入模块: from forgeimporters.github.wiki import GitHubWikiImporter [as 别名]
# 或者: from forgeimporters.github.wiki.GitHubWikiImporter import github_wiki_url [as 别名]
def test_convert_textile_no_leading_tabs(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'''h1. Header 1
Some text 1.
h2. Header 2
See [[Page]]'''
result = u'''# Header 1
Some text 1.
## Header 2
See [Page]'''
assert_equal(f(source, 'test.textile').strip(), result)
示例11: test_convert_markup
# 需要导入模块: from forgeimporters.github.wiki import GitHubWikiImporter [as 别名]
# 或者: from forgeimporters.github.wiki.GitHubWikiImporter import github_wiki_url [as 别名]
def test_convert_markup(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)'''
# markdown should be untouched
assert_equal(f(source, 'test.md'), source)
assert_equal(f(u'h1. Hello', 't.textile').strip(), u'# Hello')