add testing support for new format Asciidoc

This commit is contained in:
Martin A. Brown 2016-03-09 08:09:52 -08:00
parent 631e8fed83
commit a488ae53de
4 changed files with 16 additions and 11 deletions

4
TODO
View File

@ -8,10 +8,6 @@ user-visible needs
* add support for .epub3 (or just .epub?)
* add support for asciidoc; instantiate a new instance of Docbook4XML
with a SourceDocument of the generated result of asciidoc --backend
docbook
* consider adding support for metadata extraction from documents
* create TLDP DocBook 5.0 XSL files (if we care)

View File

@ -35,7 +35,7 @@ ex_docbook5xml = Namespace(
ex_asciidoc = Namespace(
doctype=tldp.doctypes.asciidoc.Asciidoc,
filename=opj(sampledocs, 'text-simple.txt'),
filename=opj(sampledocs, 'asciidoc-complete.txt'),
)
#
# ex_rst = Namespace(
@ -43,11 +43,6 @@ ex_asciidoc = Namespace(
# filename=opj(sampledocs, 'restructuredtext-simple.rst'),
# )
#
# ex_text = Namespace(
# doctype=tldp.doctypes.text.Text,
# filename=opj(sampledocs, 'text-simple.txt'),
# )
#
# ex_markdown = Namespace(
# doctype=tldp.doctypes.markdown.Markdown,
# filename=opj(sampledocs, 'markdown-simple.md'),

View File

@ -306,9 +306,22 @@ class TestDriverProcessSkips(TestInventoryBase):
self.assertEquals(len(inc) + 1, len(inv.all.keys()))
@unittest.skip("Except when you want to spend time....")
# @unittest.skip("Except when you want to spend time....")
class TestDriverBuild(TestInventoryBase):
def test_build_asciidoc(self):
self.add_docbook4xml_xsl_to_config()
c = self.config
c.build = True
self.add_new('Frobnitz-Asciidoc-HOWTO', example.ex_asciidoc)
inv = tldp.inventory.Inventory(c.pubdir, c.sourcedir)
self.assertEquals(1, len(inv.all.keys()))
docs = inv.all.values()
c.skip = []
tldp.driver.publish(c, docs)
doc = docs.pop(0)
self.assertTrue(doc.output.iscomplete)
def test_build_linuxdoc(self):
c = self.config
c.build = True

View File

@ -21,6 +21,7 @@ class Asciidoc(Docbook4XML):
required = {'asciidoc_asciidoc': isexecutable,
'asciidoc_xmllint': isexecutable,
}
required.update(Docbook4XML.required)
def make_docbook45(self):
s = '''"{config.asciidoc_asciidoc}" \\