Modified Files: README config.py test_t1.py test_wsdl.py xmethods.tar.gz Added a couple tests and an explanation of how to add new tests. ----------------------------------------------------------------------main
@@ -6,6 +6,44 @@ TESTS: | |||||
test_t1 -- Basic test, just checks that wsdl and xsd objects are in the | test_t1 -- Basic test, just checks that wsdl and xsd objects are in the | ||||
right places. | right places. | ||||
ADDING TESTS: | |||||
1. For Stand-Alone tests add WSDL FILE to appropriate archive file | |||||
Need to add a NEW Archive?: | |||||
config.py [files] "archive" -- tuple of all archive files, | |||||
if you need to create a new archive append the archive | |||||
name to the 'archive' tuple. | |||||
2. Edit config.py section(s): | |||||
option -- name by which service will be referenced in test case. | |||||
Need an entry under appropriate section(s), this name | |||||
must be unique within each section it appears but it may | |||||
appear in multiple sections. | |||||
config.py "test" sections: | |||||
Stand-Alone -- add "option" under [services_by_file] | |||||
eg. amazon = exports/AmazonWebServices.wsdl | |||||
Network -- add "option" under [services_by_http] | |||||
eg. amazon = http://soap.amazon.com/schemas/AmazonWebServices.wsdl | |||||
Broken -- add "option" under [broken] | |||||
3. In test module(s) | |||||
a. Add test case: | |||||
#eg. test_t1.py | |||||
class AmazonTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'amazon' | |||||
self.loadFromConfig(CONFIG) | |||||
b. Add class name of test case to CASES list. | |||||
CASES = [AirportTestCase, | |||||
AmazonTestCase, | |||||
.... etc | |||||
4. Done | |||||
CONTENTS OF SAMPLE WSDL/XSD: | CONTENTS OF SAMPLE WSDL/XSD: | ||||
schema -- Taken from globus-3.0.1(http://www.globus.org) | schema -- Taken from globus-3.0.1(http://www.globus.org) | ||||
@@ -25,6 +63,6 @@ CONTENTS OF SAMPLE WSDL/XSD: | |||||
siteInspect.wsdl | siteInspect.wsdl | ||||
TemperatureService.wsdl | TemperatureService.wsdl | ||||
usweather.wsdl | usweather.wsdl | ||||
rtf2html.xml | |||||
SolveSystem.wsdl.xml | |||||
zip2geo.wsdl | zip2geo.wsdl | ||||
@@ -37,6 +37,7 @@ siteInsepct = xmethods/siteInspect.wsdl | |||||
TemperatureService = xmethods/TemperatureService.wsdl | TemperatureService = xmethods/TemperatureService.wsdl | ||||
usweather = xmethods/usweather.wsdl | usweather = xmethods/usweather.wsdl | ||||
zip2geo = xmethods/zip2geo.wsdl | zip2geo = xmethods/zip2geo.wsdl | ||||
SolveSystem = xmethods/SolveSystem.wsdl.xml | |||||
########################################################################## | ########################################################################## | ||||
@@ -46,6 +47,15 @@ zip2geo = xmethods/zip2geo.wsdl | |||||
[services_by_http] | [services_by_http] | ||||
amazon = http://soap.amazon.com/schemas/AmazonWebServices.wsdl | amazon = http://soap.amazon.com/schemas/AmazonWebServices.wsdl | ||||
homelandsecurity = http://www.boyzoid.com/threat.cfc?wsdl | homelandsecurity = http://www.boyzoid.com/threat.cfc?wsdl | ||||
rtf2html = http://www.infoaccelerator.net/cfc/rft2html.cfc?WSDL | |||||
SolveSystem = http://www.lixusnet.com/SolveSystem.wsdl | |||||
########################################################################## | |||||
# SECTION [broken] - Legal challenges. Appears to be a problem | |||||
# in the wsdl. | |||||
########################################################################## | |||||
[broken] | |||||
rtf2html = http://www.infoaccelerator.net/cfc/rft2html.cfc?WSDL | |||||
rtf2html = xmethods/rtf2html.xml | |||||
@@ -6,6 +6,16 @@ from test_wsdl import WSDLToolsTestCase, NETWORK, STANDALONE | |||||
CONFIG = None | CONFIG = None | ||||
class HomeLandSecurityTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'homelandsecurity' | |||||
self.loadFromConfig(CONFIG) | |||||
class Rtf2htmlTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'rtf2html' | |||||
self.loadFromConfig(CONFIG) | |||||
class AmazonTestCase(WSDLToolsTestCase): | class AmazonTestCase(WSDLToolsTestCase): | ||||
def test(self): | def test(self): | ||||
self.option = 'amazon' | self.option = 'amazon' | ||||
@@ -21,7 +31,103 @@ class OGSITestCase(WSDLToolsTestCase): | |||||
self.option = 'ogsi' | self.option = 'ogsi' | ||||
self.loadFromConfig(CONFIG) | self.loadFromConfig(CONFIG) | ||||
CASES = [AmazonTestCase, AirportTestCase, OGSITestCase] | |||||
class BooksTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'books' | |||||
self.loadFromConfig(CONFIG) | |||||
class DistanceTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'distance' | |||||
self.loadFromConfig(CONFIG) | |||||
class FreeDBTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'freedb' | |||||
self.loadFromConfig(CONFIG) | |||||
class GlobalWeatherTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'globalweather' | |||||
self.loadFromConfig(CONFIG) | |||||
class IHaddockTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'IHaddock' | |||||
self.loadFromConfig(CONFIG) | |||||
class Ip2geoTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'ip2geo' | |||||
self.loadFromConfig(CONFIG) | |||||
class MagicTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'magic' | |||||
self.loadFromConfig(CONFIG) | |||||
class QueryTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'query' | |||||
self.loadFromConfig(CONFIG) | |||||
class RateInfoTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'RateInfo' | |||||
self.loadFromConfig(CONFIG) | |||||
class SHA1EncryptTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'SHA1Encrypt' | |||||
self.loadFromConfig(CONFIG) | |||||
class SiteInspectTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'siteInspect' | |||||
self.loadFromConfig(CONFIG) | |||||
class SolveSystemsTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'SolveSystem' | |||||
self.loadFromConfig(CONFIG) | |||||
class TemperatureServiceTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'TemperatureService' | |||||
self.loadFromConfig(CONFIG) | |||||
class USweatherTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'usweather' | |||||
self.loadFromConfig(CONFIG) | |||||
class Zip2geoTestCase(WSDLToolsTestCase): | |||||
def test(self): | |||||
self.option = 'zip2geo' | |||||
self.loadFromConfig(CONFIG) | |||||
CASES = [AirportTestCase, | |||||
AmazonTestCase, | |||||
BooksTestCase, | |||||
DistanceTestCase, | |||||
FreeDBTestCase, | |||||
GlobalWeatherTestCase, | |||||
HomeLandSecurityTestCase, | |||||
IHaddockTestCase, | |||||
Ip2geoTestCase, | |||||
MagicTestCase, | |||||
OGSITestCase, | |||||
QueryTestCase, | |||||
RateInfoTestCase, | |||||
Rtf2htmlTestCase, | |||||
SHA1EncryptTestCase, | |||||
SiteInspectTestCase, | |||||
SolveSystemsTestCase, | |||||
TemperatureServiceTestCase, | |||||
USweatherTestCase, | |||||
WSDLToolsTestCase, | |||||
Zip2geoTestCase] | |||||
def makeNetworkSuite(): | def makeNetworkSuite(): | ||||
return getSuite(NETWORK) | return getSuite(NETWORK) | ||||
@@ -32,8 +138,9 @@ def getSuite(section): | |||||
tests = [] | tests = [] | ||||
suite = unittest.TestSuite() | suite = unittest.TestSuite() | ||||
loader = unittest.TestLoader() | loader = unittest.TestLoader() | ||||
WSDLToolsTestCase.section = section | |||||
for case in CASES: | for case in CASES: | ||||
case.section = section | |||||
#case.section = section | |||||
test = loader.loadTestsFromTestCase(case) | test = loader.loadTestsFromTestCase(case) | ||||
tests.append(test) | tests.append(test) | ||||
suite.addTests(tests) | suite.addTests(tests) | ||||
@@ -26,11 +26,11 @@ class WSDLToolsTestCase(unittest.TestCase): | |||||
self.wsdlTypes() | self.wsdlTypes() | ||||
def loadFromConfig(self, config=CONFIG): | def loadFromConfig(self, config=CONFIG): | ||||
self.wsdl = None | |||||
try: | try: | ||||
print config | |||||
path = config.get(self.section, self.option) | path = config.get(self.section, self.option) | ||||
except NoOptionError, ex: | except NoOptionError, ex: | ||||
self.wsdl = None | |||||
pass | |||||
else: | else: | ||||
if path[:7] == 'http://': | if path[:7] == 'http://': | ||||
self.loadFromURL(url=path) | self.loadFromURL(url=path) | ||||