# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import os from pelican.readers import Readers from pelican.tests.support import unittest, get_settings from .asciidoc_reader import ENABLED CUR_DIR = os.path.dirname(__file__) CONTENT_PATH = os.path.join(CUR_DIR, 'test_data') @unittest.skipUnless(ENABLED, "asciidoc isn't installed") class AsciiDocReaderTest(unittest.TestCase): def read_file(self, path, **kwargs): # Isolate from future API changes to readers.read_file r = Readers(settings=get_settings(**kwargs)) return r.read_file(base_path=CONTENT_PATH, path=path) def test_article_with_asc_extension(self): # Ensure the asc extension is being processed by the correct reader page = self.read_file( path='article_with_asc_extension.asc') expected = ('
The quick brown fox jumped over ' 'the lazy dog’s back.
' 'version 1.0.42
The quick brown fox jumped over ' 'the lazy dog’s back.
' '