[svn r38120] Make sure that those test run on same machine when run.
(This is broader issue - we probably need to do some exclusive lock on files given to process_rest_file and such) --HG-- branch : trunk
This commit is contained in:
parent
6477b43d9b
commit
e5091b7e9d
|
@ -13,36 +13,44 @@ def setup_module(mod):
|
||||||
not py.path.local.sysfind("dot") or \
|
not py.path.local.sysfind("dot") or \
|
||||||
not py.path.local.sysfind("latex"):
|
not py.path.local.sysfind("latex"):
|
||||||
py.test.skip("ghostscript, graphviz and latex needed")
|
py.test.skip("ghostscript, graphviz and latex needed")
|
||||||
|
mod.data = py.magic.autopath().dirpath().join("data")
|
||||||
|
|
||||||
data = py.magic.autopath().dirpath().join("data")
|
class TestRst2Pdf(object):
|
||||||
|
def _process_rest_file(self):
|
||||||
|
data = py.magic.autopath().dirpath().join("data")
|
||||||
|
part2 = data.join("part1.txt")
|
||||||
|
pdf = part2.new(ext="pdf")
|
||||||
|
process_rest_file(part2)
|
||||||
|
assert pdf.check()
|
||||||
|
pdf.remove()
|
||||||
|
|
||||||
def test_process_rest_file():
|
def _process_configfile(self):
|
||||||
part2 = data.join("part1.txt")
|
data = py.magic.autopath().dirpath().join("data")
|
||||||
pdf = part2.new(ext="pdf")
|
config = data.join("example.rst2pdfconfig")
|
||||||
process_rest_file(part2)
|
pdf = config.new(ext="pdf")
|
||||||
assert pdf.check()
|
tex = data.join('example.tex')
|
||||||
pdf.remove()
|
process_configfile(config, debug=True)
|
||||||
|
assert pdf.check()
|
||||||
|
assert tex.check()
|
||||||
|
texcontent = tex.read()
|
||||||
|
assert "Generated by" in texcontent
|
||||||
|
assert "Docutils" in texcontent
|
||||||
|
process_configfile(config, debug=False)
|
||||||
|
assert pdf.check()
|
||||||
|
assert not tex.check()
|
||||||
|
pdf.remove()
|
||||||
|
|
||||||
def test_process_configfile():
|
def _process_all(self):
|
||||||
config = data.join("example.rst2pdfconfig")
|
# fallback test: only checks that no exception is raised
|
||||||
pdf = config.new(ext="pdf")
|
def rec(p):
|
||||||
tex = data.join('example.tex')
|
return p.check(dotfile=0)
|
||||||
process_configfile(config, debug=True)
|
|
||||||
assert pdf.check()
|
|
||||||
assert tex.check()
|
|
||||||
texcontent = tex.read()
|
|
||||||
assert "Generated by" in texcontent
|
|
||||||
assert "Docutils" in texcontent
|
|
||||||
process_configfile(config, debug=False)
|
|
||||||
assert pdf.check()
|
|
||||||
assert not tex.check()
|
|
||||||
pdf.remove()
|
|
||||||
|
|
||||||
def test_process_all():
|
for x in data.visit("*.rst2pdfconfig", rec=rec):
|
||||||
# fallback test: only checks that no exception is raised
|
process_configfile(x)
|
||||||
def rec(p):
|
for x in data.visit("*.txt", rec=rec):
|
||||||
return p.check(dotfile=0)
|
process_rest_file(x)
|
||||||
for x in data.visit("*.txt", rec=rec):
|
|
||||||
yield process_rest_file, x
|
def test_rst2pdf(self):
|
||||||
for x in data.visit("*.rst2pdfconfig", rec=rec):
|
self._process_rest_file()
|
||||||
yield process_configfile, x
|
self._process_configfile()
|
||||||
|
self._process_all()
|
||||||
|
|
Loading…
Reference in New Issue