You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

157 lines
4.0 KiB

  1. #!/usr/bin/env python
  2. import unittest, sys
  3. from ConfigParser import ConfigParser
  4. from ZSI.wstools.WSDLTools import WSDLReader
  5. from test_wsdl import WSDLToolsTestCase, NETWORK, STANDALONE
  6. CONFIG = None
  7. class HomeLandSecurityTestCase(WSDLToolsTestCase):
  8. def test(self):
  9. self.option = 'homelandsecurity'
  10. self.loadFromConfig(CONFIG)
  11. class Rtf2htmlTestCase(WSDLToolsTestCase):
  12. def test(self):
  13. self.option = 'rtf2html'
  14. self.loadFromConfig(CONFIG)
  15. class AmazonTestCase(WSDLToolsTestCase):
  16. def test(self):
  17. self.option = 'amazon'
  18. self.loadFromConfig(CONFIG)
  19. class AirportTestCase(WSDLToolsTestCase):
  20. def test(self):
  21. self.option = 'airport'
  22. self.loadFromConfig(CONFIG)
  23. class OGSITestCase(WSDLToolsTestCase):
  24. def test(self):
  25. self.option = 'ogsi'
  26. self.loadFromConfig(CONFIG)
  27. class BooksTestCase(WSDLToolsTestCase):
  28. def test(self):
  29. self.option = 'books'
  30. self.loadFromConfig(CONFIG)
  31. class DistanceTestCase(WSDLToolsTestCase):
  32. def test(self):
  33. self.option = 'distance'
  34. self.loadFromConfig(CONFIG)
  35. class FreeDBTestCase(WSDLToolsTestCase):
  36. def test(self):
  37. self.option = 'freedb'
  38. self.loadFromConfig(CONFIG)
  39. class GlobalWeatherTestCase(WSDLToolsTestCase):
  40. def test(self):
  41. self.option = 'globalweather'
  42. self.loadFromConfig(CONFIG)
  43. class IHaddockTestCase(WSDLToolsTestCase):
  44. def test(self):
  45. self.option = 'IHaddock'
  46. self.loadFromConfig(CONFIG)
  47. class Ip2geoTestCase(WSDLToolsTestCase):
  48. def test(self):
  49. self.option = 'ip2geo'
  50. self.loadFromConfig(CONFIG)
  51. class MagicTestCase(WSDLToolsTestCase):
  52. def test(self):
  53. self.option = 'magic'
  54. self.loadFromConfig(CONFIG)
  55. class QueryTestCase(WSDLToolsTestCase):
  56. def test(self):
  57. self.option = 'query'
  58. self.loadFromConfig(CONFIG)
  59. class RateInfoTestCase(WSDLToolsTestCase):
  60. def test(self):
  61. self.option = 'RateInfo'
  62. self.loadFromConfig(CONFIG)
  63. class SHA1EncryptTestCase(WSDLToolsTestCase):
  64. def test(self):
  65. self.option = 'SHA1Encrypt'
  66. self.loadFromConfig(CONFIG)
  67. class SiteInspectTestCase(WSDLToolsTestCase):
  68. def test(self):
  69. self.option = 'siteInspect'
  70. self.loadFromConfig(CONFIG)
  71. class SolveSystemsTestCase(WSDLToolsTestCase):
  72. def test(self):
  73. self.option = 'SolveSystem'
  74. self.loadFromConfig(CONFIG)
  75. class TemperatureServiceTestCase(WSDLToolsTestCase):
  76. def test(self):
  77. self.option = 'TemperatureService'
  78. self.loadFromConfig(CONFIG)
  79. class USweatherTestCase(WSDLToolsTestCase):
  80. def test(self):
  81. self.option = 'usweather'
  82. self.loadFromConfig(CONFIG)
  83. class Zip2geoTestCase(WSDLToolsTestCase):
  84. def test(self):
  85. self.option = 'zip2geo'
  86. self.loadFromConfig(CONFIG)
  87. CASES = [AirportTestCase,
  88. AmazonTestCase,
  89. BooksTestCase,
  90. DistanceTestCase,
  91. FreeDBTestCase,
  92. GlobalWeatherTestCase,
  93. HomeLandSecurityTestCase,
  94. IHaddockTestCase,
  95. Ip2geoTestCase,
  96. MagicTestCase,
  97. OGSITestCase,
  98. QueryTestCase,
  99. RateInfoTestCase,
  100. Rtf2htmlTestCase,
  101. SHA1EncryptTestCase,
  102. SiteInspectTestCase,
  103. SolveSystemsTestCase,
  104. TemperatureServiceTestCase,
  105. USweatherTestCase,
  106. WSDLToolsTestCase,
  107. Zip2geoTestCase]
  108. def makeNetworkSuite():
  109. return getSuite(NETWORK)
  110. def makeStandAloneSuite():
  111. return getSuite(STANDALONE)
  112. def getSuite(section):
  113. tests = []
  114. suite = unittest.TestSuite()
  115. loader = unittest.TestLoader()
  116. WSDLToolsTestCase.section = section
  117. for case in CASES:
  118. #case.section = section
  119. test = loader.loadTestsFromTestCase(case)
  120. tests.append(test)
  121. suite.addTests(tests)
  122. return suite
  123. def main():
  124. global CONFIG
  125. from test_wstools import CONFIG_FILE
  126. CONFIG = ConfigParser()
  127. CONFIG.read(CONFIG_FILE)
  128. unittest.TestProgram(defaultTest='makeStandAloneSuite')
  129. if __name__ == "__main__" : main()