summaryrefslogtreecommitdiffstats
path: root/ZSI/wstools/test/test_wstools.py
blob: 0e0f9582bfbd96100995557d1681270de072a2bc (plain) (blame)
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
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python

############################################################################
# Joshua R. Boverhof, David W. Robertson, LBNL
# See LBNLCopyright for copyright notice!
###########################################################################

import unittest, tarfile, os, ConfigParser
import test_wsdl


SECTION='files'
CONFIG_FILE = 'config.txt'

def extractFiles(section, option):
    config = ConfigParser.ConfigParser()
    config.read(CONFIG_FILE)
    archives = config.get(section, option)
    archives = eval(archives)
    for file in archives:
        tar = tarfile.open(file)
        if not os.access(tar.membernames[0], os.R_OK):
            for i in tar.getnames(): 
                tar.extract(i)

def makeTestSuite():
    suite = unittest.TestSuite()
    suite.addTest(test_wsdl.makeTestSuite("services_by_file"))
    return suite

def main():
    extractFiles(SECTION, 'archives')
    unittest.main(defaultTest="makeTestSuite")

if __name__ == "__main__" : main()