File: tests.py

package info (click to toggle)
python-clips 1.0.7.348%2Bclips-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,376 kB
  • ctags: 2,544
  • sloc: ansic: 17,065; python: 5,668; sh: 20; makefile: 12
file content (25 lines) | stat: -rw-r--r-- 608 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# tests.py
# perform some unit tests
# revision $Id: tests.py 188 2004-11-10 20:04:34Z Franz $

import unittest
import glob

execfile('test_00.py')
for x in glob.glob("test_[a-z]*.py"): execfile(x)
def is_test_class(x):
    try: return issubclass(eval(x), ctestcase)
    except: return False
def is_test_function(x):
    try: return x.startswith('ctf_')
    except: return False

suite = unittest.TestSuite()
for x in filter(is_test_class, dir()):
    for y in filter(is_test_function, dir(eval(x))):
        suite.addTest(eval("%s('%s')" % (x, y)))

unittest.TextTestRunner(verbosity=2).run(suite)


# end.