add testing support for new format Asciidoc

pull/5/head
Martin A. Brown 7 years ago
parent 631e8fed83
commit a488ae53de
  1. 4
      TODO
  2. 7
      tests/example.py
  3. 15
      tests/test_driver.py
  4. 1
      tldp/doctypes/asciidoc.py

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

@ -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'),

@ -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

@ -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}" \\

Loading…
Cancel
Save