source: TI02-CSML/trunk/services/3rdParty/OWSLib-0.2.0/tests/runalltests.py @ 2194

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI02-CSML/trunk/services/3rdParty/OWSLib-0.2.0/tests/runalltests.py@2194
Revision 2194, 1.7 KB checked in by lawrence, 13 years ago (diff)

Adding various specs and 3rd party code of interest for the CSML
services development.

Line 
1# $Id: runalltests.py,v 1.1.1.1 2004/12/06 03:28:23 sgillies Exp $
2
3# =============================================================================
4# OWSLib. Copyright (C) 2004 Sean C. Gillies
5#
6# This program is free software; you can redistribute it and/or modify it
7# under the terms of the GNU General Public License as published by the Free
8# Software Foundation; either version 2 of the License, or (at your option)
9# any later version.
10#
11# This program is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14# details.
15#
16# You should have received a copy of the GNU General Public License along with
17# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18# Place, Suite 330, Boston, MA 02111-1307 USA
19#
20# Contact email: sgillies@frii.com
21# =============================================================================
22
23import doctest
24import glob
25import os, sys
26import unittest
27
28verbosity = 1
29try:
30    opts, args = getopt.getopt(sys.argv[1:], 'v')
31    if opts[0][0] == '-v':
32        verbosity = verbosity + 1
33except:
34    pass
35
36runner = unittest.TextTestRunner(verbosity=verbosity)
37suite = unittest.TestSuite()
38load = unittest.defaultTestLoader.loadTestsFromModule
39
40tests = os.listdir(os.curdir)
41tests = [n[:-3] for n in tests if n.startswith('test') and n.endswith('.py')]
42
43for test in tests:
44    m = __import__(test)
45    suite.addTest(load(m))
46
47# Add doctests
48for file in glob.glob('*.txt'):
49    suite.addTest(doctest.DocFileSuite(file))
50   
51# =============================================================================
52# Run
53if __name__ == '__main__':
54    runner.run(suite)
55
Note: See TracBrowser for help on using the repository browser.