bundled wstools-0.3
[p2pool.git] / wstools / tests / test_wstools.py
1 #!/usr/bin/env python
2
3 ############################################################################
4 # Joshua R. Boverhof, David W. Robertson, LBNL
5 # See LBNLCopyright for copyright notice!
6 ###########################################################################
7
8 import unittest, tarfile, os, ConfigParser
9 import test_wsdl
10
11
12 SECTION='files'
13 CONFIG_FILE = 'config.txt'
14
15 def extractFiles(section, option):
16     config = ConfigParser.ConfigParser()
17     config.read(CONFIG_FILE)
18     archives = config.get(section, option)
19     archives = eval(archives)
20     for file in archives:
21         tar = tarfile.open(file)
22         if not os.access(tar.membernames[0], os.R_OK):
23             for i in tar.getnames(): 
24                 tar.extract(i)
25
26 def makeTestSuite():
27     suite = unittest.TestSuite()
28     suite.addTest(test_wsdl.makeTestSuite("services_by_file"))
29     return suite
30
31 def main():
32     extractFiles(SECTION, 'archives')
33     unittest.main(defaultTest="makeTestSuite")
34
35 if __name__ == "__main__" : main()
36     
37