tests: fix RL_HOME reference problems
authorrgbecker
Thu, 22 Jan 2009 16:51:24 +0000
changeset 3075 5175c093a0dd
parent 3074 b7270812af81
child 3076 6a959200100d
tests: fix RL_HOME reference problems
tests/test_docstrings.py
tests/test_extra.py
tests/test_platypus_general.py
tests/test_pyfiles.py
--- a/tests/test_docstrings.py	Thu Jan 22 15:55:13 2009 +0000
+++ b/tests/test_docstrings.py	Thu Jan 22 16:51:24 2009 +0000
@@ -9,7 +9,7 @@
 Currently, methods with leading and trailing double underscores
 are skipped.
 """
-from reportlab.lib.testutils import setOutDir,SecureTestCase, GlobDirectoryWalker, outputfile, printLocation, RL_HOME
+from reportlab.lib.testutils import setOutDir,SecureTestCase, GlobDirectoryWalker, outputfile, printLocation
 setOutDir(__name__)
 import os, sys, glob, string, re, unittest
 from types import ModuleType, ClassType, MethodType, FunctionType
@@ -101,6 +101,7 @@
         "Write log file for different kind of documentable objects."
 
         cwd = os.getcwd()
+        from reportlab.lib.testutils import RL_HOME
         objects = getModuleObjects(RL_HOME, 'reportlab', objType)
         objects.sort()
         os.chdir(cwd)
--- a/tests/test_extra.py	Thu Jan 22 15:55:13 2009 +0000
+++ b/tests/test_extra.py	Thu Jan 22 16:51:24 2009 +0000
@@ -1,7 +1,7 @@
 """This executes tests defined outside the normal test suite.
 See docstring for class ExternalTestCase for more information.
 """
-from reportlab.lib.testutils import setOutDir,SecureTestCase, printLocation, RL_HOME
+from reportlab.lib.testutils import setOutDir,SecureTestCase, printLocation
 setOutDir(__name__)
 import os, string, fnmatch, re, sys, unittest
 EXTRA_FILE = 'extra.txt'
@@ -40,6 +40,7 @@
 
         # look for a file named 'extra.txt' in test directory,
         # exit if not found
+        from reportlab.lib.testutils import RL_HOME
         extraFilename = os.path.join(RL_HOME, 'test', EXTRA_FILE)
         if not os.path.exists(extraFilename):
             return
--- a/tests/test_platypus_general.py	Thu Jan 22 15:55:13 2009 +0000
+++ b/tests/test_platypus_general.py	Thu Jan 22 16:51:24 2009 +0000
@@ -212,7 +212,7 @@
         """, styleSheet['BodyText']))
     #we can use the bullet feature to do a definition list
     story.append(Paragraph("""
-        <para color=green bcolor=red bg=pink>This is a contrived object to give an example of a Flowable -
+        <para color=green bcolor=red bg=pink>This is a <font bgcolor=yellow color=red>contrived</font> object to give an example of a Flowable -
         just a fixed-size box with an X through it and a centred string.</para>""",
             styleSheet['Definition'],
             bulletText='XBox  '  #hack - spot the extra space after
--- a/tests/test_pyfiles.py	Thu Jan 22 15:55:13 2009 +0000
+++ b/tests/test_pyfiles.py	Thu Jan 22 16:51:24 2009 +0000
@@ -3,7 +3,7 @@
 __version__=''' $Id$ '''
 """Tests performed on all Python source files of the ReportLab distribution.
 """
-from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, SecureTestCase, GlobDirectoryWalker, outputfile, printLocation, RL_HOME
+from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, SecureTestCase, GlobDirectoryWalker, outputfile, printLocation
 setOutDir(__name__)
 import os, sys, string, fnmatch, re
 import unittest
@@ -66,6 +66,7 @@
 
     def testAscii(self):
         "Test if Python files are pure ASCII ones."
+        from reportlab.lib.testutils import RL_HOME
         allPyFiles = GlobDirectoryWalker(RL_HOME, '*.py')
 
         for path in allPyFiles:
@@ -87,6 +88,7 @@
     def testTrailingDigits(self):
         "Test if Python files contain trailing digits."
 
+        from reportlab.lib.testutils import RL_HOME
         allPyFiles = GlobDirectoryWalker(RL_HOME, '*.py')
 
         for path in allPyFiles:
@@ -128,6 +130,7 @@
         file = open(path, 'w')
         file.write('No Unix-like first line found in the files below.\n\n')
 
+        from reportlab.lib.testutils import RL_HOME
         paths = self.findSuspiciousModules(RL_HOME, 'reportlab')
         paths.sort()