示例#1
0
文件: test_intl.py 项目: ezc/sphinx-1
def test_text_literalblock_warnings(app, warning):
    app.build()
    # --- check warning for literal block
    result = (app.outdir / 'literalblock.txt').text(encoding='utf-8')
    expect = (u"I18N WITH LITERAL BLOCK"
              u"\n***********************\n"
              u"\nCORRECT LITERAL BLOCK:\n"
              u"\n   this is"
              u"\n   literal block\n"
              u"\nMISSING LITERAL BLOCK:\n"
              u"\n<SYSTEM MESSAGE:")
    assert_startswith(result, expect)

    warnings = getwarning(warning)
    expected_warning_expr = u'.*/literalblock.txt:\\d+: ' \
                            u'WARNING: Literal block expected; none found.'
    assert_re_search(expected_warning_expr, warnings)
示例#2
0
文件: test_intl.py 项目: nwf/sphinx
def test_text_literalblock_warnings(app, warning):
    app.build()
    # --- check warning for literal block
    result = (app.outdir / 'literalblock.txt').text(encoding='utf-8')
    expect = (u"I18N WITH LITERAL BLOCK"
              u"\n***********************\n"
              u"\nCORRECT LITERAL BLOCK:\n"
              u"\n   this is"
              u"\n   literal block\n"
              u"\nMISSING LITERAL BLOCK:\n"
              u"\n<SYSTEM MESSAGE:")
    assert_startswith(result, expect)

    warnings = getwarning(warning)
    expected_warning_expr = u'.*/literalblock.txt:\\d+: ' \
                            u'WARNING: Literal block expected; none found.'
    assert_re_search(expected_warning_expr, warnings)
示例#3
0
文件: test_intl.py 项目: ezc/sphinx-1
def test_text_subdirs(app):
    app.build()
    # --- check translation in subdirs
    result = (app.outdir / 'subdir' / 'contents.txt').text(encoding='utf-8')
    assert_startswith(result, u"subdir contents\n***************\n")
示例#4
0
文件: test_intl.py 项目: ezc/sphinx-1
def test_text_toctree(app):
    app.build()
    result = (app.outdir / 'contents.txt').text(encoding='utf-8')
    assert_startswith(result, u"CONTENTS\n********\n\nTABLE OF CONTENTS\n")
示例#5
0
文件: test_intl.py 项目: nwf/sphinx
def test_text_subdirs(app):
    app.build()
    # --- check translation in subdirs
    result = (app.outdir / 'subdir' / 'contents.txt').text(encoding='utf-8')
    assert_startswith(result, u"subdir contents\n***************\n")
示例#6
0
文件: test_intl.py 项目: nwf/sphinx
def test_text_toctree(app):
    app.build()
    result = (app.outdir / 'contents.txt').text(encoding='utf-8')
    assert_startswith(result, u"CONTENTS\n********\n\nTABLE OF CONTENTS\n")