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)
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")
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")