happydoc-checkins Mailing List for HappyDoc (Page 14)
Brought to you by:
doughellmann,
krlosaqp
You can subscribe to this list here.
2002 |
Jan
(3) |
Feb
(40) |
Mar
(1) |
Apr
|
May
(12) |
Jun
(4) |
Jul
|
Aug
(39) |
Sep
|
Oct
(4) |
Nov
(49) |
Dec
(78) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(54) |
Feb
|
Mar
(41) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(13) |
From: Doug H. <dou...@us...> - 2002-02-03 21:44:48
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv8594 Modified Files: test_happydoc.py Log Message: Code formatting changes. Renamed a few test methods. Brought a few old tests back-online in different form. Index: test_happydoc.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/test_happydoc.py,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** test_happydoc.py 2002/02/03 18:51:28 1.79 --- test_happydoc.py 2002/02/03 21:44:45 1.80 *************** *** 203,206 **** --- 203,212 ---- return + def testSelfHTMLCompact(self): + assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), + extraArgs=('formatter_compactHTML=yes',)) + ), 'Full self documentation with compact output test failed.' + return + def testHTMLSingleFile(self): assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), *************** *** 255,259 **** def testImportsFromPackages(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test_import_packages_basic'),), ) ), 'Import from packages test failed.' --- 261,266 ---- def testImportsFromPackages(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', ! 'test_import_packages_basic'),), ) ), 'Import from packages test failed.' *************** *** 261,265 **** def testBasicImportsFromPackagesIgnorePackages(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test_import_packages'),), extraArgs=('docset_usePackages=0',), ) --- 268,273 ---- def testBasicImportsFromPackagesIgnorePackages(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', ! 'test_import_packages'),), extraArgs=('docset_usePackages=0',), ) *************** *** 268,272 **** def testOutputWithPrefix(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', 'test_import_packages_basic'),), extraArgs=('-p', '', --- 276,281 ---- def testOutputWithPrefix(self): ! assert (not self.runHappyDoc( (os.path.join('TestCases', ! 'test_import_packages_basic'),), extraArgs=('-p', '', *************** *** 280,289 **** ## - # def testSelfDia(self): - # assert (not self.runHappyDoc( ('../HappyDoc',), - # extraArgs=('--dia',)) - # ), 'Full self documentation test in dia format failed.' - # return - def testSelfHTML(self): assert (not self.runHappyDoc( (os.path.join(os.pardir, 'HappyDoc'),), --- 289,292 ---- *************** *** 292,302 **** return ! # def testSelfHTMLCompact(self): ! # assert (not self.runHappyDoc( ('../HappyDoc',), ! # extraArgs=('formatter_compactHTML=yes',)) ! # ), 'Full self documentation with compact output test failed.' ! # return ! ! def testSelfDocBookSingleFile(self): assert (not self.runHappyDoc( (os.path.join(os.pardir, 'HappyDoc'),), extraArgs=('-F', --- 295,299 ---- return ! def testSelfSGMLDocBookSingleFile(self): assert (not self.runHappyDoc( (os.path.join(os.pardir, 'HappyDoc'),), extraArgs=('-F', *************** *** 307,311 **** return ! def testSelfDocBookSSingleFile(self): assert (not self.runHappyDoc( (os.path.join(os.pardir, 'HappyDoc'),), extraArgs=('-F', --- 304,308 ---- return ! def testSelfDocBookXSingleFile(self): assert (not self.runHappyDoc( (os.path.join(os.pardir, 'HappyDoc'),), extraArgs=('-F', *************** *** 315,333 **** ), 'Full self documentation in DocBookS format output test failed.' return - - # def testSelfDocBookXML(self): - # assert (not self.runHappyDoc( ('../HappyDoc',), - # extraArgs=('-F', - # 'docbookx', - # '-T', - # 'mstruct')) - # ), 'Full self documentation in DocBookX format output test failed.' - # return - - # def testSelfPlainText(self): - # assert (not self.runHappyDoc( ('../HappyDoc',), - # extraArgs=('-F', 'Text')) - # ), 'Full self documentation-as-text test failed.' - # return --- 312,315 ---- *************** *** 382,386 **** def testPluginLoader(self): ! self.externalApp(os.path.join(os.curdir, 'TestCases', 'test_plugin_loader', 'runtest.py')) return --- 364,370 ---- def testPluginLoader(self): ! self.externalApp(os.path.join(os.curdir, 'TestCases', ! 'test_plugin_loader', ! 'runtest.py')) return *************** *** 436,440 **** def ZopeTestFactory(**nargs): ! nargs['workingDir'] = nargs.get('workingDir', os.path.join(os.pardir, 'Zope-2-CVS-src')) return apply(ZopeTest, (), nargs) --- 420,425 ---- def ZopeTestFactory(**nargs): ! nargs['workingDir'] = nargs.get('workingDir', os.path.join(os.pardir, ! 'Zope-2-CVS-src')) return apply(ZopeTest, (), nargs) *************** *** 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 --- 439,444 ---- 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 |
From: Doug H. <dou...@us...> - 2002-02-03 18:51:32
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv31313 Modified Files: test_happydoc.py Log Message: Fixed handling for main program to branch based on platform type. Index: test_happydoc.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/test_happydoc.py,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** test_happydoc.py 2002/02/03 18:45:12 1.78 --- test_happydoc.py 2002/02/03 18:51:28 1.79 *************** *** 759,762 **** if __name__ == '__main__': ! #main(sys.argv[1:]) ! debug() --- 759,764 ---- if __name__ == '__main__': ! if os.name == 'nt': ! debug() ! else: ! main(sys.argv[1:]) |
From: Doug H. <dou...@us...> - 2002-02-03 18:50:13
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib/formatter In directory usw-pr-cvs1:/tmp/cvs-serv30907/happydoclib/formatter Modified Files: formatter_HTMLFile.py Log Message: Changed paths in tests to be more platform-neutral. Index: formatter_HTMLFile.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/formatter/formatter_HTMLFile.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** formatter_HTMLFile.py 2001/11/11 18:53:44 1.3 --- formatter_HTMLFile.py 2002/02/03 18:50:09 1.4 *************** *** 765,769 **** def testReferences(self): ! filenames = [ './happydoclib/CommandLineApp.py' ] import happydoclib.parseinfo import happydoclib.happydocset --- 765,769 ---- def testReferences(self): ! filenames = [ os.path.join(os.curdir, 'happydoclib', 'CommandLineApp.py') ] import happydoclib.parseinfo import happydoclib.happydocset *************** *** 778,782 **** formatter = docset._formatter reference = formatter.getNamedReference( cla, 'CommandLineApp', 'index.html' ) ! expected_reference = '<a href="happydoclib/CommandLineApp.py.html#CommandLineApp">CommandLineApp</a>' assert reference == expected_reference, 'Got reference "%s" instead of "%s"' % \ (reference, expected_reference) --- 778,782 ---- formatter = docset._formatter reference = formatter.getNamedReference( cla, 'CommandLineApp', 'index.html' ) ! expected_reference = '<a href="happydoclib%sCommandLineApp.py.html#CommandLineApp">CommandLineApp</a>' % os.sep assert reference == expected_reference, 'Got reference "%s" instead of "%s"' % \ (reference, expected_reference) |
From: Doug H. <dou...@us...> - 2002-02-03 18:49:29
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib/formatter In directory usw-pr-cvs1:/tmp/cvs-serv30664/happydoclib/formatter Modified Files: fileformatterbase.py Log Message: Changed path handling to be more platform-neutral. Index: fileformatterbase.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/formatter/fileformatterbase.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** fileformatterbase.py 2002/02/02 14:58:42 1.6 --- fileformatterbase.py 2002/02/03 18:49:26 1.7 *************** *** 220,229 **** # Root node for docset # ! output_subdir = os.sep + happydoclib.path.removePrefix(docset_base_directory, output_base) happydoclib.TRACE.writeVar(output_subdir=output_subdir) if output_subdir != output_base: ! if output_subdir[0] == '/': output_subdir=output_subdir[1:] ! happydoclib.TRACE.writeVar(output_subdir=output_subdir) obj_output_sub_path = happydoclib.path.join(output_subdir, obj_output_name) happydoclib.TRACE.writeVar(obj_output_sub_path=obj_output_sub_path) --- 220,234 ---- # Root node for docset # ! output_subdir = happydoclib.path.removePrefix(docset_base_directory, output_base) happydoclib.TRACE.writeVar(output_subdir=output_subdir) + if os.name != 'nt': + happydoclib.TRACE.write('adding prefix for os %s' % os.name) + output_subdir = '%s%s' % (os.sep, output_subdir) + happydoclib.TRACE.writeVar(output_subdir=output_subdir) if output_subdir != output_base: ! happydoclib.TRACE.write('output_subdir and output_base do not match') ! if output_subdir[0] == os.sep: output_subdir=output_subdir[1:] ! happydoclib.TRACE.writeVar(output_subdir=output_subdir) obj_output_sub_path = happydoclib.path.join(output_subdir, obj_output_name) happydoclib.TRACE.writeVar(obj_output_sub_path=obj_output_sub_path) *************** *** 233,236 **** --- 238,242 ---- name = happydoclib.path.join(output_base, obj_output_sub_path) else: + happydoclib.TRACE.write('output_subdir and output_base do match') name = happydoclib.path.join(output_base, obj_output_name) *************** *** 428,431 **** --- 434,450 ---- return + def testGetFullOutputNameForObjectNone(self): + info_obj = None + expected = os.sep + os.path.join('docset', + 'base', + 'directory', + 'index.test' + ) + actual = self.formatter.getFullOutputNameForObject(info_obj) + assert expected == actual, \ + 'Output name for object does not match ("%s" vs "%s")' % \ + (expected, actual) + return + def testGetFullOutputNameForObjectFullyQualifiedNameOneParent(self): import happydoclib.happydom |
From: Doug H. <dou...@us...> - 2002-02-03 18:48:50
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv30445/happydoclib Modified Files: path.py Log Message: Changed one more test to not use hard-coded path values to attempt for platform-neutrality. Changed removeRelativePrefix() to be more platform-neutral. Index: path.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/path.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** path.py 2002/02/02 13:49:47 1.6 --- path.py 2002/02/03 18:48:47 1.7 *************** *** 72,75 **** --- 72,82 ---- # + def isSomethingThatLooksLikeDirectory(path): + return (os.path.isdir(path) + or + os.path.islink(path) + or + os.path.ismount(path) + ) def rmkdir(path): *************** *** 80,86 **** if len(parts) > 1: parent, child = parts ! if not (os.path.isdir(parent) or os.path.islink(parent)): rmkdir(parent) ! if not (os.path.isdir(path) or os.path.islink(path)): os.mkdir(path) return --- 87,93 ---- if len(parts) > 1: parent, child = parts ! if not isSomethingThatLooksLikeDirectory(parent): rmkdir(parent) ! if not isSomethingThatLooksLikeDirectory(path): os.mkdir(path) return *************** *** 285,290 **** Returns a new string, unless no changes are made. """ ! if filename and filename[0] in '.': ! while filename and (filename[0] in './'): filename = filename[1:] return filename --- 292,298 ---- Returns a new string, unless no changes are made. """ ! chars_to_remove = os.curdir + os.sep ! if filename and filename[0] == os.curdir: ! while filename and (filename[0] in chars_to_remove): filename = filename[1:] return filename *************** *** 485,489 **** def testComputeRelativeHTMLLinkUpOneDirectory(self): ! expected = '../my.gif' actual = computeRelativeHTMLLink('index.html', os.path.join(os.pardir, 'my.gif'), --- 493,497 ---- def testComputeRelativeHTMLLinkUpOneDirectory(self): ! expected = os.path.join(os.pardir, 'my.gif') actual = computeRelativeHTMLLink('index.html', os.path.join(os.pardir, 'my.gif'), |
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() |
From: Doug H. <dou...@us...> - 2002-02-02 14:58:45
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib/formatter In directory usw-pr-cvs1:/tmp/cvs-serv21733/happydoclib/formatter Modified Files: fileformatterbase.py Log Message: Added new test methods to demonstrate the expected values from the fileformatterbase methods. Index: fileformatterbase.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/formatter/fileformatterbase.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** fileformatterbase.py 2002/02/02 13:46:27 1.5 --- fileformatterbase.py 2002/02/02 14:58:42 1.6 *************** *** 59,62 **** --- 59,63 ---- # import happydoclib + import happydoclib.StreamFlushTest as StreamFlushTest # *************** *** 277,278 **** --- 278,468 ---- "Return the filename prefix value for this formatter instance." return self._filename_prefix + + + class FileFormatterBaseTest(StreamFlushTest.StreamFlushTest): + + output_base_dir = os.sep + os.path.join('tmp', 'fakedocset', 'output') + + def setUp(self): + + class FakeDocset: + def getOutputBaseDirectory(self): + return FileFormatterBaseTest.output_base_dir + + def getDocsetBaseDirectory(self): + return os.sep + os.path.join('docset', 'base', 'directory') + + class TestFormatter(FileBasedFormatter): + def getFilenameExtension(self): + return 'test' + def getRootNodeName(self): + return 'index.test' + + self.formatter = TestFormatter(FakeDocset()) + return + + def testFixUpOutputFilenameFromRoot(self): + expected = os.sep + os.path.join('fix', 'up', 'filename') + actual = self.formatter.fixUpOutputFilename( + os.sep + os.path.join('fix', 'up', 'filename') + ) + assert expected == actual, \ + 'Fixed filenames do not match ("%s" vs. "%s").' % (expected, actual) + return + + def testFixUpOutputFilenameParentDir(self): + expected = os.path.join('fix', 'up', 'filename') + actual = self.formatter.fixUpOutputFilename( + os.path.join(os.pardir, 'fix', 'up', 'filename') + ) + assert expected == actual, \ + 'Fixed filenames do not match ("%s" vs. "%s").' % (expected, actual) + return + + def testFixUpOutputFilenameCurrentDir(self): + expected = os.path.join('fix', 'up', 'filename') + actual = self.formatter.fixUpOutputFilename( + os.path.join(os.curdir, 'fix', 'up', 'filename') + ) + assert expected == actual, \ + 'Fixed filenames do not match ("%s" vs. "%s").' % (expected, actual) + return + + def testGetOutputNameForFileAtRoot(self): + filename = 'filename.py' + expected = '%s.%s' % (filename, 'test') + actual = self.formatter.getOutputNameForFile(filename) + assert expected == actual, \ + 'Filenames do not match ("%s" vs. "%s").' % (expected, actual) + return + + def testGetOutputNameForObjectNone(self): + info_obj = None + expected = 'index.test' + actual = self.formatter.getOutputNameForObject(info_obj) + assert expected == actual, \ + 'Output name for object does not match ("%s" vs "%s")' % \ + (expected, actual) + return + + def testGetOutputNameForObjectString(self): + info_obj = 'filename.test' + expected = 'filename.test' + actual = self.formatter.getOutputNameForObject(info_obj) + assert expected == actual, \ + 'Output name for object does not match ("%s" vs "%s")' % \ + (expected, actual) + return + + def testGetOutputNameForObjectFile(self): + info_obj = open('tmpfile.test', 'wt') + expected = 'tmpfile.test' + actual = self.formatter.getOutputNameForObject(info_obj) + assert expected == actual, \ + 'Output name for object does not match ("%s" vs "%s")' % \ + (expected, actual) + return + + def testGetOutputNameForObjectFullyQualifiedNameRoot(self): + import happydoclib.happydom + class FakeInfoObj(happydoclib.happydom.HappyDOM): + pass + info_obj = FakeInfoObj('myfake', None, 'filename.py', []) + expected = 'filename.py.test' + actual = self.formatter.getOutputNameForObject(info_obj) + assert expected == actual, \ + 'Output name for object does not match ("%s" vs "%s")' % \ + (expected, actual) + return + + def testGetOutputNameForObjectFullyQualifiedNameOneParent(self): + import happydoclib.happydom + class FakeInfoObj(happydoclib.happydom.HappyDOM): + pass + parent_obj = FakeInfoObj('myfakeparent', None, 'parent', []) + info_obj = FakeInfoObj('myfake', parent_obj, 'filename.py', []) + expected = 'parent_myfake.test' + actual = self.formatter.getOutputNameForObject(info_obj) + assert expected == actual, \ + 'Output name for object does not match ("%s" vs "%s")' % \ + (expected, actual) + return + + def testGetLocalOutputNameForObjectFullyQualifiedNameRoot(self): + import happydoclib.happydom + class FakeInfoObj(happydoclib.happydom.HappyDOM): + pass + info_obj = FakeInfoObj('myfake', None, 'filename.py', []) + expected = 'filename.py.test' + actual = self.formatter.getLocalOutputNameForObject(info_obj) + assert expected == actual, \ + 'Output name for object does not match ("%s" vs "%s")' % \ + (expected, actual) + return + + def testGetLocalOutputNameForObjectFullyQualifiedNameOneParent(self): + import happydoclib.happydom + class FakeInfoObj(happydoclib.happydom.HappyDOM): + pass + parent_obj = FakeInfoObj('myfakeparent', None, 'parent', []) + info_obj = FakeInfoObj('myfake', parent_obj, 'filename.py', []) + expected = 'parent_myfake.test' + actual = self.formatter.getLocalOutputNameForObject(info_obj) + assert expected == actual, \ + 'Output name for object does not match ("%s" vs "%s")' % \ + (expected, actual) + return + + def testGetFullOutputNameForObjectFullyQualifiedNameRoot(self): + import happydoclib.happydom + class FakeInfoObj(happydoclib.happydom.HappyDOM): + pass + info_obj = FakeInfoObj('myfake', None, 'filename.py', []) + expected = os.sep + os.path.join('tmp', 'fakedocset', 'output', + 'filename.py.test' + ) + actual = self.formatter.getFullOutputNameForObject(info_obj) + assert expected == actual, \ + 'Output name for object does not match ("%s" vs "%s")' % \ + (expected, actual) + return + + def testGetFullOutputNameForObjectFullyQualifiedNameOneParent(self): + import happydoclib.happydom + class FakeInfoObj(happydoclib.happydom.HappyDOM): + pass + parent_obj = FakeInfoObj('myfakeparent', None, 'parent', []) + info_obj = FakeInfoObj('myfake', parent_obj, 'filename.py', []) + expected = os.sep + os.path.join('tmp', 'fakedocset', 'output', + 'parent_myfake.test' + ) + actual = self.formatter.getFullOutputNameForObject(info_obj) + assert expected == actual, \ + 'Output name for object does not match ("%s" vs "%s")' % \ + (expected, actual) + return + + def testGetFullOutputNameForFileFullyQualifiedNameRoot(self): + filename = 'filename.py' + expected = os.sep + os.path.join('tmp', 'fakedocset', 'output', + 'filename.py.test' + ) + actual = self.formatter.getFullOutputNameForFile(filename) + assert expected == actual, \ + 'Output name for file does not match ("%s" vs "%s")' % \ + (expected, actual) + return + + def testGetFullOutputNameForFileFullyQualifiedNameOneParent(self): + filename = os.path.join('parentdir', 'filename.py') + expected = os.sep + os.path.join('tmp', 'fakedocset', 'output', + 'parentdir', + 'filename.py.test' + ) + actual = self.formatter.getFullOutputNameForFile(filename) + assert expected == actual, \ + 'Output name for file does not match ("%s" vs "%s")' % \ + (expected, actual) + return + + |
From: Doug H. <dou...@us...> - 2002-02-02 13:53:05
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv10201/happydoclib Modified Files: happydocset.py Log Message: Allow files ending .cgi to be documented. When testing, pass status message function down so that output can be shown. Index: happydocset.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/happydocset.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** happydocset.py 2001/12/09 15:36:01 1.6 --- happydocset.py 2002/02/02 13:53:02 1.7 *************** *** 613,617 **** def processFiles(self, fileNames, ! moduleFileName=re.compile(r'^.*\.py$').match, ): """Get information about a list of files. --- 613,617 ---- def processFiles(self, fileNames, ! moduleFileName=re.compile(r'^.*\.(py|cgi)$').match, ): """Get information about a list of files. *************** *** 688,692 **** self.processFiles(dir_contents) ! elif moduleFileName(file_name): # # Record that we paid attention to this file --- 688,695 ---- self.processFiles(dir_contents) ! elif ( not happydoclib.path.isdir(file_name) ! and ! moduleFileName(file_name) ! ): # # Record that we paid attention to this file *************** *** 706,709 **** --- 709,719 ---- else: self.append(file_info) + + else: + # + # Ignoring + # + self.statusMessage('Ignoring %s' % file_name, 4) + happydoclib.TRACE.outof() return *************** *** 847,850 **** --- 857,861 ---- inputModuleNames=[ filename ], outputBaseDirectory=self.output_dir, + statusMessageFunc=self.status_message_func, ) for m in docset.data: *************** *** 888,891 **** --- 899,903 ---- outputBaseDirectory=self.output_dir, includePrivateNames=includePrivateNames, + statusMessageFunc=self.status_message_func, ) assert len(docset.data) == 1, 'Did not get expected docset.' *************** *** 934,937 **** --- 946,950 ---- def testIgnoreDirectories(self): + "Ignore some subdirectories." filename = '../HappyDoc' import happydoclib.formatter.formatter_Null *************** *** 947,950 **** --- 960,964 ---- outputBaseDirectory=self.output_dir, ignoreDirFunc=self._testIgnoreDirectoriesTestFunc, + statusMessageFunc=self.status_message_func, ) for m in docset.data: |
From: Doug H. <dou...@us...> - 2002-02-02 13:49:50
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv9645/happydoclib Modified Files: path.py Log Message: Changed hard-coded test values to use dynamically constructed values using os.sep, os.pardir, os.curdir, and os.path.join. Index: path.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/path.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** path.py 2001/11/25 14:13:39 1.5 --- path.py 2002/02/02 13:49:47 1.6 *************** *** 334,339 **** def testApplyPrefixToPath(self): ! expected = '/BLAH_tmp/BLAH_foo' ! actual = applyPrefixToPath('/tmp/foo', 'BLAH_') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 334,339 ---- def testApplyPrefixToPath(self): ! expected = os.path.join('BLAH_tmp', 'BLAH_foo') ! actual = applyPrefixToPath(os.path.join('tmp', 'foo'), 'BLAH_') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 350,355 **** def testApplyPrefixToPathRelative(self): ! expected = '../BLAH_tmp/BLAH_foo' ! actual = applyPrefixToPath('../tmp/foo', 'BLAH_') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 350,355 ---- def testApplyPrefixToPathRelative(self): ! expected = os.path.join(os.pardir, 'BLAH_tmp', 'BLAH_foo') ! actual = applyPrefixToPath(os.path.join(os.pardir, 'tmp', 'foo'), 'BLAH_') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 359,363 **** def testRemovePrefix(self): expected = 'foo' ! actual = removePrefix('/tmp/foo', '/tmp') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 359,363 ---- def testRemovePrefix(self): expected = 'foo' ! actual = removePrefix(os.sep + os.path.join('tmp', 'foo'), os.sep + 'tmp') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 366,371 **** def testRemovePrefixNotThere(self): ! expected = 'tmp/foo' ! actual = removePrefix('/tmp/foo', '/blah') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 366,371 ---- def testRemovePrefixNotThere(self): ! expected = os.path.join('tmp', 'foo') ! actual = removePrefix(os.path.join('tmp', 'foo'), os.sep + 'blah') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 375,379 **** def testRemovePrefixEmptyPath(self): expected = '' ! actual = removePrefix('', '/blah') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 375,379 ---- def testRemovePrefixEmptyPath(self): expected = '' ! actual = removePrefix('', os.sep + 'blah') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 382,387 **** def testRemovePrefixEmptyPrefix(self): ! expected = 'tmp/foo' ! actual = removePrefix('/tmp/foo', '') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 382,387 ---- def testRemovePrefixEmptyPrefix(self): ! expected = os.path.join('tmp', 'foo') ! actual = removePrefix(os.path.join('tmp', 'foo'), '') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 390,395 **** def testCommonPrefix(self): ! expected = '/tmp' ! actual = commonPrefix('/tmp/foo', '/tmp/blah') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 390,396 ---- def testCommonPrefix(self): ! expected = os.sep + 'tmp' ! actual = commonPrefix(os.sep + os.path.join('tmp', 'foo'), ! os.sep + os.path.join('tmp', 'blah')) assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 399,403 **** def testCommonPrefixNone(self): expected = '' ! actual = commonPrefix('/var/tmp/foo', '/tmp/blah') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 400,406 ---- def testCommonPrefixNone(self): expected = '' ! actual = commonPrefix(os.path.join('var', 'tmp', 'foo'), ! os.path.join('tmp', 'blah') ! ) assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 407,416 **** def testCommonPrefixEmptyPaths(self): expected = '' ! actual = commonPrefix('', '/tmp/blah') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ % (expected, actual) expected = '' ! actual = commonPrefix('/var/tmp/foo', '') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 410,419 ---- def testCommonPrefixEmptyPaths(self): expected = '' ! actual = commonPrefix('', os.path.join('tmp', 'blah')) assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ % (expected, actual) expected = '' ! actual = commonPrefix(os.path.join('var', 'tmp', 'foo'), '') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 419,424 **** def testJoinWithCommonMiddle(self): ! expected = '/root/one/two/three/filename.txt' ! actual = joinWithCommonMiddle('/root/one', '/root/one/two', 'two/three/filename.txt') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 422,430 ---- def testJoinWithCommonMiddle(self): ! expected = os.path.join('root', 'one', 'two', 'three', 'filename.txt') ! actual = joinWithCommonMiddle(os.path.join('root', 'one'), ! os.path.join('root', 'one', 'two'), ! os.path.join('two', 'three', 'filename.txt') ! ) assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 427,432 **** def testJoinWithCommonMiddleNotCommon(self): ! expected = '/root/one/four/two/three/filename.txt' ! actual = joinWithCommonMiddle('/root/one/five', '/root/one/four', 'two/three/filename.txt') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 433,441 ---- def testJoinWithCommonMiddleNotCommon(self): ! expected = os.path.join('root', 'one', 'four', 'two', 'three', 'filename.txt') ! actual = joinWithCommonMiddle(os.path.join('root', 'one', 'five'), ! os.path.join('root', 'one', 'four'), ! os.path.join('two', 'three', 'filename.txt') ! ) assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 435,440 **** def testJoinWithCommonMiddleEmptyPrefix(self): ! expected = '/root/one/four/two/three/filename.txt' ! actual = joinWithCommonMiddle('', '/root/one/four', 'two/three/filename.txt') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 444,452 ---- def testJoinWithCommonMiddleEmptyPrefix(self): ! expected = os.path.join('root', 'one', 'four', 'two', 'three', 'filename.txt') ! actual = joinWithCommonMiddle('', ! os.path.join('root', 'one', 'four'), ! os.path.join('two', 'three', 'filename.txt') ! ) assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 443,448 **** def testJoinWithCommonMiddleEmptyPath1(self): ! expected = 'two/three/filename.txt' ! actual = joinWithCommonMiddle('/root/one/five', '', 'two/three/filename.txt') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 455,463 ---- def testJoinWithCommonMiddleEmptyPath1(self): ! expected = os.path.join('two', 'three', 'filename.txt') ! actual = joinWithCommonMiddle(os.path.join('root', 'one', 'five'), ! '', ! os.path.join('two', 'three', 'filename.txt') ! ) assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 452,457 **** def testJoinWithCommonMiddleEmptyPath2(self): ! expected = '/root/one/two/' ! actual = joinWithCommonMiddle('/root/one', '/root/one/two', '') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 467,474 ---- def testJoinWithCommonMiddleEmptyPath2(self): ! expected = os.path.join('root', 'one', 'two') + os.sep ! actual = joinWithCommonMiddle(os.path.join('root', 'one'), ! os.path.join('root', 'one', 'two'), ! '') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 469,473 **** def testComputeRelativeHTMLLinkUpOneDirectory(self): expected = '../my.gif' ! actual = computeRelativeHTMLLink('index.html', '../my.gif', '/tmp/base/dir') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 486,493 ---- def testComputeRelativeHTMLLinkUpOneDirectory(self): expected = '../my.gif' ! actual = computeRelativeHTMLLink('index.html', ! os.path.join(os.pardir, 'my.gif'), ! os.path.join('tmp', 'base', 'dir') ! ) assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 477,484 **** def testComputeRelativeHTMLLinkInParentDirectory(self): ! expected = '../my.gif' ! actual = computeRelativeHTMLLink('/tmp/base/dir/index.html', ! '/tmp/base/my.gif', ! '/tmp/base') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 497,506 ---- def testComputeRelativeHTMLLinkInParentDirectory(self): ! expected = os.path.join(os.pardir, 'my.gif') ! actual = computeRelativeHTMLLink( ! os.path.join('tmp', 'base', 'dir', 'index.html'), ! os.path.join('tmp', 'base', 'my.gif'), ! os.path.join('tmp', 'base') ! ) assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 488,492 **** def testRemoveRelativePrefixCurrentDir(self): expected = 'foo' ! actual = removeRelativePrefix('./foo') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 510,514 ---- def testRemoveRelativePrefixCurrentDir(self): expected = 'foo' ! actual = removeRelativePrefix(os.path.join(os.curdir, 'foo')) assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ *************** *** 496,500 **** def testRemoveRelativePrefixParentDir(self): expected = 'foo' ! actual = removeRelativePrefix('../foo') assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ --- 518,522 ---- def testRemoveRelativePrefixParentDir(self): expected = 'foo' ! actual = removeRelativePrefix(os.path.join(os.pardir, 'foo')) assert actual == expected, \ 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ |
From: Doug H. <dou...@us...> - 2002-02-02 13:46:30
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib/formatter In directory usw-pr-cvs1:/tmp/cvs-serv9141/happydoclib/formatter Modified Files: fileformatterbase.py Log Message: Added more documentation. Index: fileformatterbase.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/formatter/fileformatterbase.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** fileformatterbase.py 2001/11/11 18:53:44 1.4 --- fileformatterbase.py 2002/02/02 13:46:27 1.5 *************** *** 111,115 **** def fixUpOutputFilename(self, filename): ! """Tweak the filename to remove relative references and add the safe prefix.""" # # Remove preceding slashes to make name relative --- 111,121 ---- def fixUpOutputFilename(self, filename): ! """Tweak the filename to remove relative references ! and add the safe prefix. ! ! Returns a relative path, but without the ./ or ../ at the ! front. This path will then, usually, be tacked on the end of ! the output path to create a full path. ! """ # # Remove preceding slashes to make name relative *************** *** 125,133 **** def getOutputNameForFile(self, filename): ! """ ! Return the base name of the thing to which output should be ! written for a file. This is usually a file name, but could be ! anything understood by the formatter as a name. If infoObject ! is None, return the name for a root node for this formatter. """ happydoclib.TRACE.into('FileBasedFormatter', 'getOutputNameForFile', --- 131,140 ---- def getOutputNameForFile(self, filename): ! """Return the base name of the thing to which output should be ! written for a file. ! ! This is usually a file name, but could be anything understood ! by the formatter as a name. If infoObject is None, return the ! name for a root node for this formatter. """ happydoclib.TRACE.into('FileBasedFormatter', 'getOutputNameForFile', *************** *** 146,155 **** def getOutputNameForObject(self, infoObject): ! """ ! Return the base name of the thing to which output should be written ! for an info source. This is usually a file name, but could ! be anything understood by the formatter as a name. If ! infoObject is None, return the name for a root node for this ! formatter. """ happydoclib.TRACE.into('FileBasedFormatter', 'getOutputNameForObject', --- 153,162 ---- def getOutputNameForObject(self, infoObject): ! """Return the base name of the thing to which output should be written ! for an info source. ! ! This is usually a file name, but could be anything understood ! by the formatter as a name. If infoObject is None, return the ! name for a root node for this formatter. """ happydoclib.TRACE.into('FileBasedFormatter', 'getOutputNameForObject', *************** *** 173,182 **** def getLocalOutputNameForObject(self, infoObject): ! """ ! Return a local reference to base name of the thing to which ! output should be written for an info source. This is usually ! a file name, but could be anything understood by the formatter ! as a name. If infoObject is None, return the name for a root ! node for this formatter. """ extension = self.getFilenameExtension() --- 180,189 ---- def getLocalOutputNameForObject(self, infoObject): ! """Return a local reference to base name of the thing to which ! output should be written for an info source. ! ! This is usually a file name, but could be anything understood ! by the formatter as a name. If infoObject is None, return the ! name for a root node for this formatter. """ extension = self.getFilenameExtension() *************** *** 190,194 **** def getFullOutputNameForObject(self, infoObject): ! "Get the full name, including path, to the object being output." happydoclib.TRACE.into('FileBasedFormatter', 'getFullOutputNameForObject', infoObject=infoObject) --- 197,206 ---- def getFullOutputNameForObject(self, infoObject): ! """Get the full name, including path, to the object being output. ! ! The prefix of the return value should be the output path for ! all documentation. The rest of the return value will be based ! on the path to the source for the object. ! """ happydoclib.TRACE.into('FileBasedFormatter', 'getFullOutputNameForObject', infoObject=infoObject) |
From: Doug H. <dou...@us...> - 2002-02-02 13:46:07
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv9097/happydoclib Modified Files: happyformatter.py Log Message: Added 'new' to the list of well known modules, since it does not appear to be in the path for Python 2.2 but it is importable. Index: happyformatter.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/happyformatter.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** happyformatter.py 2001/11/11 18:47:51 1.3 --- happyformatter.py 2002/02/02 13:46:04 1.4 *************** *** 120,124 **** _sys_modules.append(name) ! _well_known_names = ( 'regex', 'sys', 'thread', 'threading' ) for _name in _well_known_names: _sys_modules.append(_name) --- 120,124 ---- _sys_modules.append(name) ! _well_known_names = ( 'regex', 'sys', 'thread', 'threading', 'new' ) for _name in _well_known_names: _sys_modules.append(_name) |
From: Doug H. <dou...@us...> - 2002-02-02 13:45:33
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv8999/happydoclib Modified Files: appclass.py Log Message: Fixed use of StdOut docset type. Index: appclass.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/appclass.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** appclass.py 2001/12/16 13:09:24 1.7 --- appclass.py 2002/02/02 13:45:29 1.8 *************** *** 294,298 **** def optionHandler_o(self): "Specify that output should go to stdout." ! self.set_docset_type('stdout') return --- 294,298 ---- def optionHandler_o(self): "Specify that output should go to stdout." ! self.set_docset_type('StdOut') return |
From: Doug H. <dou...@us...> - 2002-02-02 13:45:08
|
Update of /cvsroot/happydoc/TestCases In directory usw-pr-cvs1:/tmp/cvs-serv8926/TestCases Added Files: test.cgi Log Message: New test file to look for CGI programs. --- NEW FILE: test.cgi --- #!/usr/bin/python # # Here is the module documentation # """Simple test file for HappyDoc. This module contains various test cases for testing the HappyDoc documentation generator. """ import string import CommandLineApp import os, types import TestCases.test from sys import path from token import * from TestCases.test_nested_structures import OuterClass, OuterFunction from CommandLineApp import TestApp class DefaultClassInst: "Class used for default parameter with a class instance." pass class DefaultClassInstWithParams: "Class used for default parameter with a class instance taking parameters." def __init__(self, *args): "Initialize DefaultClassInstWithParams instance." pass class DottedBaseClass(CommandLineApp.TestApp): "Class to test subclassing from a base class with dots in the name." pass class MultipleBaseClasses(DefaultClassInst, DefaultClassInstWithParams, CommandLineApp.CommandLineApp): "Class testing multiple inheritence." def __init__(self): "Initializer" pass # Here is a module level variable definition. foo=1 def example_function_with_args(arg1, arg2, arg3withDefault='hi there', arg3aWithDefault="'hi again'", arg3bWithDefault='"hi there again"', arg4DefaultInt=101, arg5DefaultTuple=(1,2), arg6DefaultList=[3,4], arg7DefaultNone=None, arg8DefaultName=foo, arg9DefaultInstance=DefaultClassInst(), arg10DefaultInstanceWithParams= \ DefaultClassInstWithParams(1, 2, ('tuple', 'param'), ['list', 'param'] ), stringArgWithHTML='<h1>Hi, Dick & Jane!</h1>', ): "This is an example function for testing purposes." if one: raise IOError('RAISE_class') else: raise 'RAISE_blah2' for i in range(1, 10): raise 'RAISE_loop' raise 'RAISE_main_level' return None def example_function_without_args(): "This example function has no arguments." pass def example_function_with_varargs(*args): "This example function takes a variable number of arguments." pass def example_function_with_kwargs(**kw): """ This example function takes variable keyword arguments. """ pass class BaseClass1: "First base class." # # classMember definition example # classMember=1 # # Documentation for method_of_bc1 # def method_of_bc1(self): pass def method2_of_bc1(self): # # Documentation for method2_of_bc1 after name # pass class SubClass1(BaseClass1): "First subclass of BaseClass1." pass class BaseClass2: "Second base class." pass class SubClass2(BaseClass1, BaseClass2): "Second subclass of BaseClass1 and BaseClass2." def anotherMethod(self): "A method not defined in the base classes." pass # # Class documentation for SubClass3. # # This class documentation section includes a lot of text, # in several paragraphs. # # See, here is another paragraph. # # We even have an example: # # a -> b -> c -> a # # And a bulleted list: # # * line one # # * line two # # * line three # class SubClass3(SubClass2, MultipleBaseClasses): pass # # Random comment inserted in text # class SubClass4(SubClass1, SubClass3): # # Class documentation for SubClass4 after the name # pass # # External docs for five are skipped because # of the blank line following the comment block # class five: # # internal docs for five # pass class OverRecursion: pass class OverRecursion(OverRecursion): pass |
From: Doug H. <dou...@us...> - 2002-02-02 13:44:37
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv8789 Modified Files: test_happydoc.py Log Message: Fixed test name for docbookx formatter. Index: test_happydoc.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/test_happydoc.py,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** test_happydoc.py 2002/01/31 13:19:41 1.76 --- test_happydoc.py 2002/02/02 13:44:34 1.77 *************** *** 302,306 **** assert (not self.runHappyDoc( ('../HappyDoc',), extraArgs=('-F', ! 'DocBookX', '-T', 'SingleFile')) --- 302,306 ---- assert (not self.runHappyDoc( ('../HappyDoc',), extraArgs=('-F', ! 'docbookx', '-T', 'SingleFile')) |
From: wrobell <wr...@us...> - 2002-01-31 18:38:04
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib/formatter In directory usw-pr-cvs1:/tmp/cvs-serv7623 Modified Files: formatter_DocBookX.py Log Message: - support for base classes - every file is valid XML file - file name extension is applied now - more documentation (should be even more!) - clean up Index: formatter_DocBookX.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/formatter/formatter_DocBookX.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** formatter_DocBookX.py 2001/10/29 12:11:32 1.2 --- formatter_DocBookX.py 2002/01/31 18:38:00 1.3 *************** *** 10,13 **** --- 10,29 ---- """XML DocBook formatter. + + All files contains XML and doctype declaration, so + every document is a valid XML file. This way, it is possible + to use every file separately. + + Every index file indicates a chapter. + Every module or class document indicates section. + + It was tested with libxml 2.4.10 and libxslt 1.0.6 (http://xmlsoft.org). + Use your favourite XML and XSLT processors with XInclude support. + + Example: + + happydoc -T mstruct -F xmldocbook my_module formatter_encoding=utf-8 + + xsltproc --xinclude my_custom_docbook_to_html.xsl my_module/index.docb > my_module.html """ *************** *** 72,79 **** apply(happydoclib.formatter.formatter_xml.XMLFormatter.__init__, \ (self, docset, encoding, index_file_name, file_name_ext), conf) ! self.filename_ext='docb' self.title=title # # XMLFormatter class abstract methods implementation. --- 88,101 ---- apply(happydoclib.formatter.formatter_xml.XMLFormatter.__init__, \ (self, docset, encoding, index_file_name, file_name_ext), conf) ! self.file_name_ext='docb' self.title=title + self.doctypes={ + INDEX_FILE: 'chapter', + MODULE_FILE: 'section', + CLASS_FILE: 'section', + } + # # XMLFormatter class abstract methods implementation. *************** *** 83,91 **** """XMLFormatter class abstract method implementation. """ if rtype==INDEX_FILE: if stage==START: - self.writeRaw('<?xml version="1.0" encoding="%s"?>\n' % self.getEncoding(), output) - self.writeRaw('<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "file:///usr/share/sgml/docbook/xml-dtd-4.1.2/docbookx.dtd">\n', output) - self.tag('chapter', output, {'xmlns:xi': 'http://www.w3.org/2001/XInclude'}) if self.title: --- 105,114 ---- """XMLFormatter class abstract method implementation. """ + if stage==START: + self.writeRaw('<?xml version="1.0" encoding="%s"?>\n' % self.getEncoding(), output) + self.writeRaw('<!DOCTYPE %s PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "file:///usr/share/sgml/docbook/xml-dtd-4.1.2/docbookx.dtd">\n' % self.doctypes[rtype], output) + if rtype==INDEX_FILE: if stage==START: self.tag('chapter', output, {'xmlns:xi': 'http://www.w3.org/2001/XInclude'}) if self.title: *************** *** 98,106 **** """XMLFormatter class abstract method implementation. """ - #if stage==START: - # self.tag('chapter', output) - # self.writeTaggedText('title', 'Package %s' % info.getName(), output) - #elif stage==END: - # self.endTag('chapter', output) pass --- 121,124 ---- *************** *** 202,206 **** """XMLFormatter class abstract method implementation. """ ! pass --- 220,237 ---- """XMLFormatter class abstract method implementation. """ ! if stage==PRE: ! self.tag('para', output) ! self.writeText('Derives from:', output) ! self.tag('itemizedlist', output) ! elif stage==START: ! self.tag('listitem', output) ! self.tag('para', output) ! self.writeText(cinfo, output) ! elif stage==END: ! self.endTag('para', output) ! self.endTag('listitem', output) ! elif stage==POST: ! self.endTag('itemizedlist', output) ! self.endTag('para', output) *************** *** 237,241 **** """XMLFormatter class abstract method implementation. """ name='%s/%s#%s' \ ! % (package_info.getName(), self.getIndexFileName(), 'xpointer(/chapter/section)') self.emptyTag('xi:include', output, { 'href': name }) --- 268,278 ---- """XMLFormatter class abstract method implementation. """ + if package_info.getName(): + pname=package_info.getName() + else: + pname=package_info.getFileName() + name='%s/%s#%s' \ ! % (pname, self.getIndexFileName(), 'xpointer(/chapter/section)') ! self.emptyTag('xi:include', output, { 'href': name }) |
From: Doug H. <dou...@us...> - 2002-01-31 13:20:28
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv15847 Modified Files: StreamFlushTest.py Log Message: Add a status message function so that different verbosity levels can produce different output. Index: StreamFlushTest.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/StreamFlushTest.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StreamFlushTest.py 2001/11/25 14:13:06 1.2 --- StreamFlushTest.py 2002/01/31 13:20:25 1.3 *************** *** 116,126 **** verboseLevel = verboseLevel ! def __init__(self, methodName, outputDir=DEFAULT_OUTPUT_DIR): "Initialize" self.name = methodName self.output_dir = outputDir unittest.TestCase.__init__(self, methodName) import happydoclib.path self.path_module = happydoclib.path return --- 116,133 ---- verboseLevel = verboseLevel ! def __init__(self, methodName, outputDir=DEFAULT_OUTPUT_DIR, ! statusMessageFunc=None): "Initialize" self.name = methodName self.output_dir = outputDir + self.status_message_func = statusMessageFunc unittest.TestCase.__init__(self, methodName) import happydoclib.path self.path_module = happydoclib.path + return + + def statusMessage(self, message, level=1): + if self.status_message_func: + self.status_message_func(message, level) return |
From: Doug H. <dou...@us...> - 2002-01-31 13:19:44
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv15591 Modified Files: test_happydoc.py Log Message: Handle test cases which may have support for status message function in constructor. Index: test_happydoc.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/test_happydoc.py,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** test_happydoc.py 2002/01/19 17:59:02 1.75 --- test_happydoc.py 2002/01/31 13:19:41 1.76 *************** *** 455,460 **** """ ! def __init__(self, outputDir, knownTestCaseClasses): self.output_dir = outputDir self.known_classes = knownTestCaseClasses return --- 455,461 ---- """ ! def __init__(self, outputDir, statusMessageFunc, knownTestCaseClasses): self.output_dir = outputDir + self.status_message_func = statusMessageFunc self.known_classes = knownTestCaseClasses return *************** *** 465,478 **** tests = [] for n in names: ! tests.append( testCaseClass(n, self.output_dir) ) return self.suiteClass(tests) def loadTestsFromName(self, name, module=None): try: ! return unittest.TestLoader.loadTestsFromName(self, name, module) except ImportError: for checking_class in self.known_classes: if name in self.getTestCaseNames(checking_class): ! return self.suiteClass([ checking_class(name, self.output_dir) ]) --- 466,493 ---- tests = [] for n in names: ! try: ! test_case = testCaseClass(n, ! outputDir=self.output_dir, ! statusMessageFunc=self.status_message_func, ! ) ! except TypeError: ! test_case = testCaseClass(n, outputDir=self.output_dir) ! ! tests.append(test_case) return self.suiteClass(tests) def loadTestsFromName(self, name, module=None): try: ! test_obj = unittest.TestLoader.loadTestsFromName(self, name, module) ! test_obj.status_message_func = self.status_message_func ! return test_obj except ImportError: for checking_class in self.known_classes: if name in self.getTestCaseNames(checking_class): ! return self.suiteClass([ ! checking_class(name, ! outputDir=self.output_dir, ! statusMessageFunc=self.status_message_func) ! ]) *************** *** 592,595 **** --- 607,611 ---- test_loader = HappyDocTestLoader(self._output_dir, + self.statusMessage, (ExecuteHappyDocTest, ZopeTest, |