mirror of https://github.com/tLDP/python-tldp
removed longer tests; pep8/pyflakes fixes
This commit is contained in:
parent
4ad4fae41b
commit
abbd433ea1
|
@ -5,7 +5,6 @@ import os
|
|||
import uuid
|
||||
import errno
|
||||
import random
|
||||
import unittest
|
||||
from tempfile import NamedTemporaryFile as ntf
|
||||
from cStringIO import StringIO
|
||||
from argparse import Namespace
|
||||
|
@ -69,7 +68,6 @@ class TestDriverDetail(TestInventoryBase):
|
|||
self.assertTrue('missing source' in stdout.read())
|
||||
|
||||
def test_run_detail(self):
|
||||
c = self.config
|
||||
self.add_published('Published-HOWTO', example.ex_linuxdoc)
|
||||
self.add_new('New-HOWTO', example.ex_linuxdoc)
|
||||
self.add_stale('Stale-HOWTO', example.ex_linuxdoc)
|
||||
|
@ -125,7 +123,6 @@ class TestDriverShowStatustypes(TestToolsFilesystem):
|
|||
class TestDriverSummary(TestInventoryBase):
|
||||
|
||||
def test_run_summary(self):
|
||||
c = self.config
|
||||
self.add_published('Published-HOWTO', example.ex_linuxdoc)
|
||||
self.add_new('New-HOWTO', example.ex_linuxdoc)
|
||||
self.add_stale('Stale-HOWTO', example.ex_linuxdoc)
|
||||
|
@ -228,6 +225,7 @@ class Testbuilddir_setup(TestToolsFilesystem):
|
|||
ready, error = tldp.driver.builddir_setup(config)
|
||||
self.assertTrue(ready)
|
||||
|
||||
|
||||
class TestremoveUnknownDoctypes(TestToolsFilesystem):
|
||||
|
||||
def test_removeUnknownDoctypes(self):
|
||||
|
@ -305,7 +303,6 @@ class TestDriverRun(TestInventoryBase):
|
|||
self.assertEquals(1, len(inv.broken.keys()))
|
||||
|
||||
def test_run_no_work(self):
|
||||
c = self.config
|
||||
self.add_published('Published-HOWTO', example.ex_linuxdoc)
|
||||
exitcode = tldp.driver.run(self.argv)
|
||||
# -- improvement: check for 'No work to do.' from logger
|
||||
|
@ -317,7 +314,6 @@ class TestDriverRun(TestInventoryBase):
|
|||
tldp.driver.run(argv)
|
||||
|
||||
def test_run_extra_args(self):
|
||||
c = self.config
|
||||
self.add_new('New-HOWTO', example.ex_linuxdoc)
|
||||
fullpath = opj(self.tempdir, 'sources', 'New-HOWTO.sgml')
|
||||
argv = self.argv
|
||||
|
@ -361,7 +357,6 @@ class TestDriverRun(TestInventoryBase):
|
|||
self.add_docbook4xml_xsl_to_config()
|
||||
c = self.config
|
||||
c.script = True
|
||||
stdout = StringIO()
|
||||
self.add_stale('Asciidoc-Stale-HOWTO', example.ex_asciidoc)
|
||||
self.add_new('DocBook4XML-New-HOWTO', example.ex_docbook4xml)
|
||||
argv = self.argv
|
||||
|
@ -430,7 +425,6 @@ class TestDriverScript(TestInventoryBase):
|
|||
self.assertTrue(c.linuxdoc_sgml2html in data)
|
||||
|
||||
def test_run_script(self):
|
||||
c = self.config
|
||||
self.add_published('Published-HOWTO', example.ex_linuxdoc)
|
||||
self.add_new('New-HOWTO', example.ex_linuxdoc)
|
||||
self.add_stale('Stale-HOWTO', example.ex_linuxdoc)
|
||||
|
@ -441,94 +435,5 @@ class TestDriverScript(TestInventoryBase):
|
|||
exitcode = tldp.driver.run(argv)
|
||||
self.assertEquals(exitcode, os.EX_OK)
|
||||
|
||||
|
||||
@unittest.skip("Except when you want to spend time....")
|
||||
class TestDriverBuild(TestInventoryBase):
|
||||
|
||||
def test_build_one_broken(self):
|
||||
self.add_docbook4xml_xsl_to_config()
|
||||
c = self.config
|
||||
c.build = True
|
||||
self.add_new('Frobnitz-DocBook-XML-4-HOWTO', example.ex_docbook4xml)
|
||||
# -- mangle the content of a valid DocBook XML file
|
||||
borked = example.ex_docbook4xml.content[:-12]
|
||||
self.add_new('Frobnitz-Borked-XML-4-HOWTO',
|
||||
example.ex_docbook4xml, content=borked)
|
||||
inv = tldp.inventory.Inventory(c.pubdir, c.sourcedir)
|
||||
self.assertEquals(2, len(inv.all.keys()))
|
||||
docs = inv.all.values()
|
||||
result = tldp.driver.build(c, docs)
|
||||
self.assertTrue('Build failed' in result)
|
||||
|
||||
def test_build_only_requested_stem(self):
|
||||
c = self.config
|
||||
ex = example.ex_linuxdoc
|
||||
self.add_published('Published-HOWTO', ex)
|
||||
self.add_new('New-HOWTO', ex)
|
||||
argv = ['--pubdir', c.pubdir, '--sourcedir', c.sourcedir[0]]
|
||||
argv.extend(['--build', 'Published-HOWTO'])
|
||||
tldp.driver.run(argv)
|
||||
inv = tldp.inventory.Inventory(c.pubdir, c.sourcedir)
|
||||
self.assertEquals(1, len(inv.published.keys()))
|
||||
self.assertEquals(1, len(inv.work.keys()))
|
||||
|
||||
|
||||
|
||||
@unittest.skip("Except when you want to spend time....")
|
||||
class TestDriverPublish(TestInventoryBase):
|
||||
|
||||
def test_publish_docbook4xml(self):
|
||||
self.add_docbook4xml_xsl_to_config()
|
||||
c = self.config
|
||||
c.publish = True
|
||||
self.add_new('Frobnitz-DocBook-XML-4-HOWTO', example.ex_docbook4xml)
|
||||
inv = tldp.inventory.Inventory(c.pubdir, c.sourcedir)
|
||||
self.assertEquals(1, len(inv.all.keys()))
|
||||
docs = inv.all.values()
|
||||
exitcode = tldp.driver.publish(c, docs)
|
||||
self.assertEquals(exitcode, 0)
|
||||
doc = docs.pop(0)
|
||||
self.assertTrue(doc.output.iscomplete)
|
||||
|
||||
def test_publish_asciidoc(self):
|
||||
self.add_docbook4xml_xsl_to_config()
|
||||
c = self.config
|
||||
c.publish = 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 = []
|
||||
exitcode = tldp.driver.publish(c, docs)
|
||||
self.assertEquals(exitcode, 0)
|
||||
doc = docs.pop(0)
|
||||
self.assertTrue(doc.output.iscomplete)
|
||||
|
||||
def test_publish_linuxdoc(self):
|
||||
c = self.config
|
||||
c.publish = True
|
||||
self.add_new('Frobnitz-Linuxdoc-HOWTO', example.ex_linuxdoc)
|
||||
inv = tldp.inventory.Inventory(c.pubdir, c.sourcedir)
|
||||
self.assertEquals(1, len(inv.all.keys()))
|
||||
docs = inv.all.values()
|
||||
c.skip = []
|
||||
exitcode = tldp.driver.publish(c, docs)
|
||||
self.assertEquals(exitcode, 0)
|
||||
doc = docs.pop(0)
|
||||
self.assertTrue(doc.output.iscomplete)
|
||||
|
||||
def test_publish_docbooksgml(self):
|
||||
self.add_docbooksgml_support_to_config()
|
||||
c = self.config
|
||||
c.publish = True
|
||||
self.add_new('Frobnitz-DocBookSGML-HOWTO', example.ex_docbooksgml)
|
||||
inv = tldp.inventory.Inventory(c.pubdir, c.sourcedir)
|
||||
self.assertEquals(1, len(inv.all.keys()))
|
||||
docs = inv.all.values()
|
||||
exitcode = tldp.driver.publish(c, docs)
|
||||
self.assertEquals(exitcode, 0)
|
||||
doc = docs.pop(0)
|
||||
self.assertTrue(doc.output.iscomplete)
|
||||
|
||||
#
|
||||
# -- end of file
|
||||
|
|
Loading…
Reference in New Issue