Skip to content

Commit

Permalink
align on 4, pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
agroszer committed Apr 1, 2016
1 parent d1654aa commit 188a015
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions src/z3c/rml/tests/test_rml.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,34 +126,36 @@ def runTest(self):


def test_suite():
suite = unittest.TestSuite()
inputDir = os.path.join(os.path.dirname(z3c.rml.tests.__file__), 'input')
outputDir = os.path.join(os.path.dirname(z3c.rml.tests.__file__), 'output')
expectDir = os.path.join(os.path.dirname(z3c.rml.tests.__file__), 'expected')
for filename in os.listdir(inputDir):
if not filename.endswith(".rml"):
continue

inPath = os.path.join(inputDir, filename)
outPath = os.path.join(outputDir, filename[:-4] + '.pdf')
expectPath = os.path.join(expectDir, filename[:-4] + '.pdf')

# ** Test RML to PDF rendering **
# Create new type, so that we can get test matching
TestCase = type(filename[:-4], (RMLRenderingTestCase,), {})
case = TestCase(inPath, outPath)
suite.addTest(case)
# ** Test PDF rendering correctness **
TestCase = type('compare-'+filename[:-4], (ComparePDFTestCase,), {})
case = TestCase(expectPath, outPath)
suite.addTest(case)

if filename == 'printScaling.rml':
TestCase = type('compare-file-'+filename[:-4], (CompareFileTestCase,), {})
suite = unittest.TestSuite()
here = os.path.dirname(z3c.rml.tests.__file__)
inputDir = os.path.join(here, 'input')
outputDir = os.path.join(here, 'output')
expectDir = os.path.join(here, 'expected')
for filename in os.listdir(inputDir):
if not filename.endswith(".rml"):
continue

inPath = os.path.join(inputDir, filename)
outPath = os.path.join(outputDir, filename[:-4] + '.pdf')
expectPath = os.path.join(expectDir, filename[:-4] + '.pdf')

# ** Test RML to PDF rendering **
# Create new type, so that we can get test matching
TestCase = type(filename[:-4], (RMLRenderingTestCase,), {})
case = TestCase(inPath, outPath)
suite.addTest(case)
# ** Test PDF rendering correctness **
TestCase = type('compare-'+filename[:-4], (ComparePDFTestCase,), {})
case = TestCase(expectPath, outPath)
suite.addTest(case)

if filename == 'printScaling.rml':
TestCase = type('compare-file-'+filename[:-4],
(CompareFileTestCase,), {})
case = TestCase(outPath, b'<< /PrintScaling /None >>')
suite.addTest(case)

return suite
return suite

if __name__ == '__main__':
unittest.main(defaultTest='test_suite')

0 comments on commit 188a015

Please sign in to comment.