Thread: [Happydoc-checkins] CVS: HappyDoc test_happydoc.py,1.77,1.78
Brought to you by:
doughellmann,
krlosaqp
From: Doug H. <dou...@us...> - 2002-02-03 18:45:18
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv29615 Modified Files: test_happydoc.py Log Message: Changed test parameters to be more platform neutral by using os.path functions and os.sep, os.curdir, and os.pardir to build up input and output names. Index: test_happydoc.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/test_happydoc.py,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** test_happydoc.py 2002/02/02 13:44:34 1.77 --- test_happydoc.py 2002/02/03 18:45:12 1.78 *************** *** 56,59 **** --- 56,60 ---- import sys import os + sys.path.append(os.getcwd()) import tempfile import string *************** *** 94,98 **** def setUp(self): ! self.happydoc = './happydoc' return --- 95,99 ---- def setUp(self): ! self.happydoc = os.path.join(os.curdir, 'happydoc') return *************** *** 104,108 **** happydoc = self.happydoc test_name = self.name ! output_dir = '%(output_dir)s/%(test_name)s' % locals() # # Verbose level setting --- 105,109 ---- happydoc = self.happydoc test_name = self.name ! output_dir = os.path.join(output_dir, test_name) # # Verbose level setting *************** *** 195,200 **** # def testHTMLSingleFile(self): ! assert (not self.runHappyDoc( ('TestCases/test.py',), extraArgs=('-p', '-', '-T', 'SingleFile') ) --- 196,208 ---- # + def testHTMLSimple(self): + assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), + extraArgs=('-p', '-',) + ) + ), 'Basic single-file docset test failed.' + return + def testHTMLSingleFile(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), extraArgs=('-p', '-', '-T', 'SingleFile') ) *************** *** 203,207 **** def testHTMLSingleFileCompact(self): ! assert (not self.runHappyDoc( ('TestCases/test.py',), extraArgs=('-p', '-', '-T', 'SingleFile', 'formatter_compactHTML=yes', --- 211,215 ---- def testHTMLSingleFileCompact(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), extraArgs=('-p', '-', '-T', 'SingleFile', 'formatter_compactHTML=yes', *************** *** 212,216 **** def testHTMLStdout(self): ! assert (not self.runHappyDoc( ('TestCases/test.py',), extraArgs=('-T', 'StdOut') ) --- 220,224 ---- def testHTMLStdout(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), extraArgs=('-T', 'StdOut') ) *************** *** 219,223 **** def testDashOStdOut(self): ! assert (not self.runHappyDoc( ('TestCases/test.py',), extraArgs=('-o',) ) --- 227,231 ---- def testDashOStdOut(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), extraArgs=('-o',) ) *************** *** 226,230 **** def testText(self): ! assert (not self.runHappyDoc( ('TestCases/test.py',), extraArgs=('-F', 'Text') ) --- 234,238 ---- def testText(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), extraArgs=('-F', 'Text') ) *************** *** 233,237 **** def testTextStdout(self): ! assert (not self.runHappyDoc( ('TestCases/test.py',), extraArgs=('-F', 'Text', '-T', 'StdOut') ) --- 241,245 ---- def testTextStdout(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), extraArgs=('-F', 'Text', '-T', 'StdOut') ) *************** *** 240,244 **** def testDia(self): ! assert (not self.runHappyDoc( ('TestCases/test_dia.py', ), extraArgs=('--dia',) ) --- 248,252 ---- def testDia(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test_dia.py'), ), extraArgs=('--dia',) ) *************** *** 247,251 **** def testImportsFromPackages(self): ! assert (not self.runHappyDoc( ('TestCases/test_import_packages_basic',), ) ), 'Import from packages test failed.' --- 255,259 ---- def testImportsFromPackages(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test_import_packages_basic'),), ) ), 'Import from packages test failed.' *************** *** 253,257 **** def testBasicImportsFromPackagesIgnorePackages(self): ! assert (not self.runHappyDoc( ('TestCases/test_import_packages',), extraArgs=('docset_usePackages=0',), ) --- 261,265 ---- def testBasicImportsFromPackagesIgnorePackages(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test_import_packages'),), extraArgs=('docset_usePackages=0',), ) *************** *** 260,264 **** def testOutputWithPrefix(self): ! assert (not self.runHappyDoc( ('TestCases/test_import_packages_basic',), extraArgs=('-p', '', --- 268,272 ---- def testOutputWithPrefix(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test_import_packages_basic'),), extraArgs=('-p', '', *************** *** 279,283 **** def testSelfHTML(self): ! assert (not self.runHappyDoc( ('../HappyDoc',), ) ), 'Full self documentation test failed.' --- 287,291 ---- def testSelfHTML(self): ! assert (not self.runHappyDoc( (os.path.join(os.pardir, 'HappyDoc'),), ) ), 'Full self documentation test failed.' *************** *** 291,295 **** def testSelfDocBookSingleFile(self): ! assert (not self.runHappyDoc( ('../HappyDoc',), extraArgs=('-F', 'SGMLDocBook', --- 299,303 ---- def testSelfDocBookSingleFile(self): ! assert (not self.runHappyDoc( (os.path.join(os.pardir, 'HappyDoc'),), extraArgs=('-F', 'SGMLDocBook', *************** *** 300,304 **** def testSelfDocBookSSingleFile(self): ! assert (not self.runHappyDoc( ('../HappyDoc',), extraArgs=('-F', 'docbookx', --- 308,312 ---- def testSelfDocBookSSingleFile(self): ! assert (not self.runHappyDoc( (os.path.join(os.pardir, 'HappyDoc'),), extraArgs=('-F', 'docbookx', *************** *** 327,331 **** def __init__(self, ! workingDir='.', outputDir='DefaultTestOutputDir', **nargs --- 335,339 ---- def __init__(self, ! workingDir=os.curdir, outputDir='DefaultTestOutputDir', **nargs *************** *** 345,349 **** def setUp(self): ! self.happydoc = '../HappyDoc/happydoc' return --- 353,357 ---- def setUp(self): ! self.happydoc = os.path.join(os.pardir, 'HappyDoc', 'happydoc') return *************** *** 374,378 **** def testPluginLoader(self): ! self.externalApp('./TestCases/test_plugin_loader/runtest.py') return --- 382,386 ---- def testPluginLoader(self): ! self.externalApp(os.path.join(os.curdir, 'TestCases', 'test_plugin_loader', 'runtest.py')) return *************** *** 382,386 **** def testZopeFull(self): ! assert (not self.runHappyDoc( ('../Zope-2-CVS-src',), ) ), 'Zope full documentation test failed.' --- 390,394 ---- def testZopeFull(self): ! assert (not self.runHappyDoc( (os.path.join(os.pardir, 'Zope-2-CVS-src'),), ) ), 'Zope full documentation test failed.' *************** *** 388,392 **** def testZopeRoot(self): ! assert (not self.runHappyDoc( ('../Zope-2-CVS-src',), extraArgs=('-r',)) ), 'Zope full documentation test failed.' --- 396,400 ---- def testZopeRoot(self): ! assert (not self.runHappyDoc( (os.path.join(os.pardir, 'Zope-2-CVS-src'),), extraArgs=('-r',)) ), 'Zope full documentation test failed.' *************** *** 394,398 **** def testGadflyParseError(self): ! assert (not self.runHappyDoc( ('../Zope-2-CVS-src/lib/python/Products/ZGadflyDA/gadfly/gfdb0.py',), extraArgs=('-r',)) ), 'Gadfly test with parse-error failed.' --- 402,414 ---- def testGadflyParseError(self): ! assert (not self.runHappyDoc( (os.path.join(os.pardir, ! 'Zope-2-CVS-src', ! 'lib', ! 'python', ! 'Products', ! 'ZGadflyDA', ! 'gadfly', ! 'gfdb0.py', ! ),), extraArgs=('-r',)) ), 'Gadfly test with parse-error failed.' *************** *** 400,404 **** def testZEOParseError(self): ! assert (not self.runHappyDoc( ('../Zope-2-CVS-src/lib/python/ZEO/zrpc.py',), extraArgs=('-r',)) ), 'ZEO test with parse-error failed.' --- 416,426 ---- def testZEOParseError(self): ! assert (not self.runHappyDoc( (os.path.join(os.pardir, ! 'Zope-2-CVS-src', ! 'lib', ! 'python', ! 'ZEO', ! 'zrpc.py', ! ),), extraArgs=('-r',)) ), 'ZEO test with parse-error failed.' *************** *** 406,410 **** def testZopeWithSafePrefix(self): ! assert (not self.runHappyDoc( ('../Zope-2-CVS-src',), extraArgs=('formatter_filenamePrefix=zsd_',)) ), 'Zope test with output prefix failed.' --- 428,432 ---- def testZopeWithSafePrefix(self): ! assert (not self.runHappyDoc( (os.path.join(os.pardir, 'Zope-2-CVS-src'),), extraArgs=('formatter_filenamePrefix=zsd_',)) ), 'Zope test with output prefix failed.' *************** *** 414,418 **** def ZopeTestFactory(**nargs): ! nargs['workingDir'] = nargs.get('workingDir', '../Zope-2-CVS-src') return apply(ZopeTest, (), nargs) --- 436,440 ---- def ZopeTestFactory(**nargs): ! nargs['workingDir'] = nargs.get('workingDir', os.path.join(os.pardir, 'Zope-2-CVS-src')) return apply(ZopeTest, (), nargs) *************** *** 432,436 **** def checkBugReport(self, bugId): print '\n%s: %s' % (bugId, os.getcwd()) ! assert not self.runHappyDoc( ('./TestCases/test_bug%s.py' % bugId, ), extraArgs=('-p', '-'), ), 'Check for bug %s failed.' % bugId --- 454,458 ---- def checkBugReport(self, bugId): print '\n%s: %s' % (bugId, os.getcwd()) ! assert not self.runHappyDoc( (os.path.join(os.curdir, 'TestCases', 'test_bug%s.py' % bugId), ), extraArgs=('-p', '-'), ), 'Check for bug %s failed.' % bugId *************** *** 513,516 **** --- 535,547 ---- ## + log_file=open('log.txt', 'wt') + + def statusMessage(self, msg='', level=1): + happydoclib.CommandLineApp.CommandLineApp.statusMessage( + self, msg, level) + self.log_file.write('%s\n' % msg) + self.log_file.flush() + return + def optionHandler_d(self, outputDir): "Specify the output directory for the tests." *************** *** 680,684 **** # Check tests related to bug reports # ! bug_ids = map(lambda x:x[18:-3], glob('TestCases/test_bug*.py')) bug_ids.sort() for bug in bug_ids: --- 711,715 ---- # Check tests related to bug reports # ! bug_ids = map(lambda x:x[18:-3], glob(os.path.join('TestCases', 'test_bug*.py'))) bug_ids.sort() for bug in bug_ids: *************** *** 706,709 **** --- 737,741 ---- self._operation) + self.log_file.close() return *************** *** 717,724 **** def debug(): ! main( ('-t', 'checkHelpSyntax') ) return if __name__ == '__main__': ! main(sys.argv[1:]) --- 749,762 ---- def debug(): ! os.chdir('c:\\happydoc\happydoc') ! import happydoclib.trace ! #happydoclib.trace.trace.setVerbosity(3) ! main( ('all',) ) ! #main( ('-v', ! # 'happydoclib.formatter.fileformatterbase.FileFormatterBaseTest.testGetFullOutputNameForObjectNone') ) return if __name__ == '__main__': ! #main(sys.argv[1:]) ! debug() |