diff options
| author | pinky <> | 2007-01-07 23:36:48 +0000 |
|---|---|---|
| committer | pinky <> | 2007-01-07 23:36:48 +0000 |
| commit | 131e3f481e8c3b131309b3ca4847d2e19abe1b42 (patch) | |
| tree | e1f7ccd411852ff92462fe57b6782319f0c26a8f /bin/reportlab/test/test_tools_pythonpoint.py | |
| parent | 1e479b40d638ce0303402b6e4af348e9ae8e8c68 (diff) | |
RL2
bzr revid: pinky-b6477822105ee9382f0078db43cf51da9cf0321a
Diffstat (limited to 'bin/reportlab/test/test_tools_pythonpoint.py')
| -rw-r--r-- | bin/reportlab/test/test_tools_pythonpoint.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/bin/reportlab/test/test_tools_pythonpoint.py b/bin/reportlab/test/test_tools_pythonpoint.py new file mode 100644 index 00000000000..bddd0138096 --- /dev/null +++ b/bin/reportlab/test/test_tools_pythonpoint.py @@ -0,0 +1,39 @@ +"""Tests for the PythonPoint tool. +""" +import os, sys, string +from reportlab.test import unittest +from reportlab.test.utils import makeSuiteForClasses, outputfile, printLocation +import reportlab + +class PythonPointTestCase(unittest.TestCase): + "Some very crude tests on PythonPoint." + def test0(self): + "Test if pythonpoint.pdf can be created from pythonpoint.xml." + + join, dirname, isfile, abspath = os.path.join, os.path.dirname, os.path.isfile, os.path.abspath + rlDir = abspath(dirname(reportlab.__file__)) + from reportlab.tools.pythonpoint import pythonpoint + from reportlab.lib.utils import isCompactDistro, open_for_read + ppDir = dirname(pythonpoint.__file__) + xml = join(ppDir, 'demos', 'pythonpoint.xml') + datafilename = 'pythonpoint.pdf' + outDir = outputfile('') + if isCompactDistro(): + cwd = None + xml = open_for_read(xml) + else: + cwd = os.getcwd() + os.chdir(join(ppDir, 'demos')) + pdf = join(outDir, datafilename) + if isfile(pdf): os.remove(pdf) + pythonpoint.process(xml, outDir=outDir, verbose=0, datafilename=datafilename) + if cwd: os.chdir(cwd) + assert os.path.exists(pdf) + +def makeSuite(): + return makeSuiteForClasses(PythonPointTestCase) + +#noruntests +if __name__ == "__main__": + unittest.TextTestRunner().run(makeSuite()) + printLocation() |
