예제 #1
0
def test_for_unicode_character(fakefile):
    test_string = u'\xfc'
    fakefile.read.return_value = test_string

    html_string = render_html(fakefile)

    assert test_string in html_string
예제 #2
0
def test_render_text(fakefile):
    test_string = 'Hello World'
    fakefile.read.return_value = test_string

    html_string = render_html(fakefile)

    assert test_string in html_string
예제 #3
0
def test_for_bold(fakefile):
    test_string = '**bold text**'
    fakefile.read.return_value = test_string

    target_string = '<div class="document">\n' \
                    '<p><strong>bold text</strong></p>\n' \
                    '</div>'

    html_string = render_html(fakefile)

    assert target_string in html_string
예제 #4
0
def test_for_html_tags(fakefile):
    test_string = 'What is reStructuredText?\n~~~~~~~~~~~~~~~~~~~~~~~~~'
    fakefile.read.return_value = test_string

    target_string = '<div class="document" id="what-is-restructuredtext">\n' \
                    '<h1 class="title">What is reStructuredText?</h1>\n' \
                    '</div>\n'

    html_string = render_html(fakefile)

    assert html_string == target_string