[Docstring-checkins] CVS: dps/test DPSTestSupport.py,1.2,1.3
Status: Pre-Alpha
Brought to you by:
goodger
From: David G. <go...@us...> - 2002-01-26 00:04:52
|
Update of /cvsroot/docstring/dps/test In directory usw-pr-cvs1:/tmp/cvs-serv5934/dps/test Modified Files: DPSTestSupport.py Log Message: parameterized test method Index: DPSTestSupport.py =================================================================== RCS file: /cvsroot/docstring/dps/test/DPSTestSupport.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DPSTestSupport.py 2002/01/16 02:42:06 1.2 --- DPSTestSupport.py 2002/01/26 00:04:50 1.3 *************** *** 1,5 **** #! /usr/bin/env python """ ! :Author: David Goodger :Contact: go...@us... :Revision: $Revision$ --- 1,5 ---- #! /usr/bin/env python """ ! :Authors: David Goodger; Garth Kidd :Contact: go...@us... :Revision: $Revision$ *************** *** 77,81 **** else: self.id = id - def addTestCase(self, testCaseClass, methodName, input, expected, --- 77,80 ---- *************** *** 88,93 **** Arguments: ! testCaseClass -- ! methodName -- input -- input to the parser. expected -- expected output from the parser. --- 87,92 ---- Arguments: ! testCaseClass -- ! methodName -- input -- input to the parser. expected -- expected output from the parser. *************** *** 171,176 **** CustomTestSuite.__init__(self) ! ! def generateTests(self, dict, dictname='totest'): """ Stock the suite with test cases generated from a test data dictionary. --- 170,176 ---- CustomTestSuite.__init__(self) ! ! def generateTests(self, dict, dictname='totest', ! testmethod='test_transforms'): """ Stock the suite with test cases generated from a test data dictionary. *************** *** 193,197 **** continue self.addTestCase( ! TransformTestCase, 'test_transforms', transforms=transforms, parser=self.parser, input=case[0], expected=case[1], --- 193,197 ---- continue self.addTestCase( ! TransformTestCase, testmethod, transforms=transforms, parser=self.parser, input=case[0], expected=case[1], *************** *** 216,220 **** self.parser = kwargs['parser'] """Input parser for this test case.""" ! del kwargs['transforms'], kwargs['parser'] # only wanted here CustomTestCase.__init__(self, *args, **kwargs) --- 216,220 ---- self.parser = kwargs['parser'] """Input parser for this test case.""" ! del kwargs['transforms'], kwargs['parser'] # only wanted here CustomTestCase.__init__(self, *args, **kwargs) *************** *** 227,229 **** --- 227,245 ---- transformClass().transform(doctree) output = doctree.pformat() + self.compareOutput(self.input, output, self.expected) + + def test_transforms_verbosely(self): + if self.runInDebugger: + pdb.set_trace() + print '\n', self.id + print '-' * 70 + print self.input + doctree = self.parser.parse(self.input) + print '-' * 70 + print doctree.pformat() + for transformClass in self.transforms: + transformClass().transform(doctree) + output = doctree.pformat() + print '-' * 70 + print output self.compareOutput(self.input, output, self.expected) |