summaryrefslogtreecommitdiff
path: root/src/Tests/Test.py
diff options
context:
space:
mode:
authorR. Tyler Ballance <tyler@slide.com>2009-04-16 22:32:41 -0700
committerR. Tyler Ballance <tyler@slide.com>2009-04-16 22:32:41 -0700
commit45f570f03abfbe929a14a7c23e2aa2a39ce152c5 (patch)
tree992e83fd05db4ab0231ec1a2257ba45b744376c5 /src/Tests/Test.py
parent2fc2c598e3ab45631739fe0f582fbfc18573b417 (diff)
parent1c42c232c419001116a099e4a49032231fff38fe (diff)
downloadpython-cheetah-2.1.1.tar.gz
Merge branch 'next' of git@github.com:rtyler/cheetahv2.1.1
Diffstat (limited to 'src/Tests/Test.py')
-rwxr-xr-xsrc/Tests/Test.py65
1 files changed, 21 insertions, 44 deletions
diff --git a/src/Tests/Test.py b/src/Tests/Test.py
index 9e46a5d..e168fc9 100755
--- a/src/Tests/Test.py
+++ b/src/Tests/Test.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# $Id: Test.py,v 1.44 2006/01/15 20:45:10 tavis_rudd Exp $
-"""Core module of Cheetah's Unit-testing framework
+'''
+Core module of Cheetah's Unit-testing framework
TODO
================================================================================
@@ -8,63 +8,40 @@ TODO
# negative test cases for expected exceptions
# black-box vs clear-box testing
# do some tests that run the Template for long enough to check that the refresh code works
-
-Meta-Data
-================================================================================
-Author: Tavis Rudd <tavis@damnsimple.com>,
-License: This software is released for unlimited distribution under the
- terms of the MIT license. See the LICENSE file.
-Version: $Revision: 1.44 $
-Start Date: 2001/03/30
-Last Revision Date: $Date: 2006/01/15 20:45:10 $
-"""
-__author__ = "Tavis Rudd <tavis@damnsimple.com>"
-__revision__ = "$Revision: 1.44 $"[11:-2]
-
-
-##################################################
-## DEPENDENCIES ##
+'''
import sys
import unittest_local_copy as unittest
-##################################################
-## CONSTANTS & GLOBALS
-try:
- True, False
-except NameError:
- True, False = (1==1),(1==0)
-
-##################################################
-## TESTS
import SyntaxAndOutput
import NameMapper
import Template
-import FileRefresh
import CheetahWrapper
+import Regressions
+import Unicode
-SyntaxSuite = unittest.findTestCases(SyntaxAndOutput)
-NameMapperSuite = unittest.findTestCases(NameMapper)
-TemplateSuite = unittest.findTestCases(Template)
-FileRefreshSuite = unittest.findTestCases(FileRefresh)
-if not sys.platform.startswith('java'):
- CheetahWrapperSuite = unittest.findTestCases(CheetahWrapper)
-
-from SyntaxAndOutput import *
-from NameMapper import *
-from Template import *
-from FileRefresh import *
+suites = [
+ unittest.findTestCases(SyntaxAndOutput),
+ unittest.findTestCases(NameMapper),
+ unittest.findTestCases(Template),
+ unittest.findTestCases(Regressions),
+ unittest.findTestCases(Unicode),
+]
if not sys.platform.startswith('java'):
- from CheetahWrapper import *
-
-##################################################
-## if run from the command line
+ suites.append(unittest.findTestCases(CheetahWrapper))
if __name__ == '__main__':
- unittest.main()
+ runner = unittest.TextTestRunner()
+ if 'xml' in sys.argv:
+ import xmlrunner
+ runner = xmlrunner.XMLTestRunner(filename='Cheetah-Tests.xml')
+
+ results = runner.run(unittest.TestSuite(suites))
+
+