Browse Source

----------------------------------------------------------------------

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
Joshua Boverhof 21 years ago
parent
commit
94584c4be7
5 changed files with 162 additions and 7 deletions
  1. +40
    -2
      test/README
  2. +11
    -1
      test/config.py
  3. +109
    -2
      test/test_t1.py
  4. +2
    -2
      test/test_wsdl.py
  5. BIN
      test/xmethods.tar.gz

+ 40
- 2
test/README View File

@@ -6,6 +6,44 @@ TESTS:
test_t1 -- Basic test, just checks that wsdl and xsd objects are in the
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:
schema -- Taken from globus-3.0.1(http://www.globus.org)
@@ -25,6 +63,6 @@ CONTENTS OF SAMPLE WSDL/XSD:
siteInspect.wsdl
TemperatureService.wsdl
usweather.wsdl
rtf2html.xml
SolveSystem.wsdl.xml
zip2geo.wsdl



+ 11
- 1
test/config.py View File

@@ -37,6 +37,7 @@ siteInsepct = xmethods/siteInspect.wsdl
TemperatureService = xmethods/TemperatureService.wsdl
usweather = xmethods/usweather.wsdl
zip2geo = xmethods/zip2geo.wsdl
SolveSystem = xmethods/SolveSystem.wsdl.xml


##########################################################################
@@ -46,6 +47,15 @@ zip2geo = xmethods/zip2geo.wsdl
[services_by_http]
amazon = http://soap.amazon.com/schemas/AmazonWebServices.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



+ 109
- 2
test/test_t1.py View File

@@ -6,6 +6,16 @@ from test_wsdl import WSDLToolsTestCase, NETWORK, STANDALONE

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):
def test(self):
self.option = 'amazon'
@@ -21,7 +31,103 @@ class OGSITestCase(WSDLToolsTestCase):
self.option = 'ogsi'
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():
return getSuite(NETWORK)

@@ -32,8 +138,9 @@ def getSuite(section):
tests = []
suite = unittest.TestSuite()
loader = unittest.TestLoader()
WSDLToolsTestCase.section = section
for case in CASES:
case.section = section
#case.section = section
test = loader.loadTestsFromTestCase(case)
tests.append(test)
suite.addTests(tests)


+ 2
- 2
test/test_wsdl.py View File

@@ -26,11 +26,11 @@ class WSDLToolsTestCase(unittest.TestCase):
self.wsdlTypes()

def loadFromConfig(self, config=CONFIG):
self.wsdl = None
try:
print config
path = config.get(self.section, self.option)
except NoOptionError, ex:
self.wsdl = None
pass
else:
if path[:7] == 'http://':
self.loadFromURL(url=path)


BIN
test/xmethods.tar.gz View File


Loading…
Cancel
Save