コード例 #1
0
ファイル: test_service.py プロジェクト: homeworkprod/byceps
def test_quote_with_author_whose_name_contains_square_brackets(text, expected):
    assert render_html(text) == expected
コード例 #2
0
ファイル: test_service.py プロジェクト: homeworkprod/byceps
def test_quote_without_author():
    text = '[quote]All your base are belong to us.[/quote]'
    expected = '<blockquote>All your base are belong to us.</blockquote>'
    assert render_html(text) == expected
コード例 #3
0
ファイル: test_service.py プロジェクト: homeworkprod/byceps
def test_quote_with_author():
    text = '[quote author="CATS"]All your base are belong to us.[/quote]'
    expected = '<p class="quote-intro"><cite>CATS</cite> schrieb:</p>\n<blockquote>All your base are belong to us.</blockquote>'
    assert render_html(text) == expected
コード例 #4
0
ファイル: test_service.py プロジェクト: homeworkprod/byceps
def test_image():
    text = 'before [img]http://example.com/image.png[/img] after'
    expected = 'before <img src="http://example.com/image.png"> after'
    assert render_html(text) == expected
コード例 #5
0
ファイル: test_service.py プロジェクト: homeworkprod/byceps
def test_linked_image():
    text = 'before [url=http://example.com/index.html][img]http://example.com/image.png[/img][/url] after'
    expected = 'before <a href="http://example.com/index.html"><img src="http://example.com/image.png"></a> after'
    assert render_html(text) == expected
コード例 #6
0
ファイル: test_service.py プロジェクト: homeworkprod/byceps
def test_explicit_url_linking():
    text = 'before [url]http://example.com/index.html[/url] after'
    expected = 'before <a href="http://example.com/index.html">http://example.com/index.html</a> after'
    assert render_html(text) == expected
コード例 #7
0
ファイル: test_service.py プロジェクト: homeworkprod/byceps
def test_labeled_url_linking():
    text = 'before [url=http://example.com/index.html]Example[/url] after'
    expected = 'before <a href="http://example.com/index.html">Example</a> after'
    assert render_html(text) == expected
コード例 #8
0
def test_quote_with_author():
    text = '[quote author="CATS"]All your base are belong to us.[/quote]'
    expected = '<p class="quote-intro"><cite>CATS</cite> schrieb:</p>\n<blockquote>All your base are belong to us.</blockquote>'
    assert render_html(text) == expected
コード例 #9
0
ファイル: test_service.py プロジェクト: homeworkprod/byceps
def test_auto_url_linking():
    text = 'before http://example.com/index.html after'
    expected = 'before <a href="http://example.com/index.html">http://example.com/index.html</a> after'
    assert render_html(text) == expected
コード例 #10
0
def test_linked_image():
    text = 'before [url=http://example.com/index.html][img]http://example.com/image.png[/img][/url] after'
    expected = 'before <a href="http://example.com/index.html"><img src="http://example.com/image.png"></a> after'
    assert render_html(text) == expected
コード例 #11
0
def test_quote_without_author():
    text = '[quote]All your base are belong to us.[/quote]'
    expected = '<blockquote>All your base are belong to us.</blockquote>'
    assert render_html(text) == expected
コード例 #12
0
def test_image():
    text = 'before [img]http://example.com/image.png[/img] after'
    expected = 'before <img src="http://example.com/image.png"> after'
    assert render_html(text) == expected
コード例 #13
0
def test_labeled_url_linking():
    text = 'before [url=http://example.com/index.html]Example[/url] after'
    expected = 'before <a href="http://example.com/index.html">Example</a> after'
    assert render_html(text) == expected
コード例 #14
0
def test_explicit_url_linking():
    text = 'before [url]http://example.com/index.html[/url] after'
    expected = 'before <a href="http://example.com/index.html">http://example.com/index.html</a> after'
    assert render_html(text) == expected
コード例 #15
0
def test_auto_url_linking():
    text = 'before http://example.com/index.html after'
    expected = 'before <a href="http://example.com/index.html">http://example.com/index.html</a> after'
    assert render_html(text) == expected
コード例 #16
0
ファイル: test_service.py プロジェクト: xvzf/byceps
def test_quote_with_author_whose_name_contains_square_brackets(text, expected):
    assert render_html(text) == expected