Author: jvloothuis
Date: Sun Feb 18 19:24:14 2007
New Revision: 39172
Modified:
kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/createpythontests.py
Log:
Changed the test generation so it creates one test class for a set of html files
Modified:
kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/createpythontests.py
==============================================================================
--- kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/createpythontests.py
(original)
+++ kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/createpythontests.py
Sun Feb 18 19:24:14 2007
@@ -14,8 +14,7 @@
class seltest_$testname(SeleniumTestCase):
- def test_seltest_$testname(self):
- $testbody
+$tests
def test_suite():
return unittest.makeSuite(seltest_$testname)
@@ -42,6 +41,7 @@
return 'self.%s(%s)' % (command, ', '.join(arguments))
htmlparser = HTMLTreeBuilder.TreeBuilder()
+tests = []
for filename in glob.glob('*.html'):
tree = HTMLTreeBuilder.parse(filename)
root = tree.getroot()
@@ -55,8 +55,12 @@
commands.append(formatcommand(*[td.text for td in row.findall('td')]))
testfilename = 'seltest_%s.py' % testname
- f = open(testfilename, 'wb')
- f.write(template.substitute(dict(
- testname=testname,
- testbody='\n '.join(commands))))
- f.close()
+ testbody=' def test_%s(self):\n'%testname+' '*8+'\n
'.join(commands)+'\n'
+ tests.append(testbody)
+
+f = open('seltest_all.py', 'wb')
+f.write(template.substitute(dict(
+ testname=testname,
+ tests='\n'.join(tests),
+ )))
+f.close()
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins