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

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

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

Line 
1import doctest
2import getopt
3import glob
4import sys
5
6try:
7    import pkg_resources
8    pkg_resources.require('OWSLib')
9except (ImportError, pkg_resources.DistributionNotFound):
10    pass
11
12def run(pattern):
13    if pattern is None:
14        testfiles = glob.glob('*.txt')
15    else:
16        testfiles = glob.glob(pattern)
17    for file in testfiles: 
18        doctest.testfile(file)
19
20if __name__ == "__main__":
21    try:
22        opts, args = getopt.getopt(sys.argv[1:], "t:v")
23    except getopt.GetoptError:
24        print "Usage: python runalldoctests.py [-t GLOB_PATTERN]"
25        sys.exit(2)
26    pattern = None
27    for o, a in opts:
28        if o == '-t':
29            pattern = a
30    run(pattern)
31
Note: See TracBrowser for help on using the repository browser.