00001
00002
00003
00004
00005
00006
00007 import sys, unittest
00008 from ServiceTest import main, ServiceTestCase, ServiceTestSuite
00009
00010
00011 """
00012 Unittest for contacting the threatService Web service.
00013
00014 WSDL: http://www.boyzoid.com/threat.cfc?wsdl
00015 """
00016
00017
00018 def dispatch():
00019 """Run all dispatch tests"""
00020 suite = ServiceTestSuite()
00021 suite.addTest(unittest.makeSuite(HomelandTestCase, 'test_dispatch'))
00022 return suite
00023
00024 def local():
00025 """Run all local tests"""
00026 suite = ServiceTestSuite()
00027 suite.addTest(unittest.makeSuite(HomelandTestCase, 'test_local'))
00028 return suite
00029
00030 def net():
00031 """Run all network tests"""
00032 suite = ServiceTestSuite()
00033 suite.addTest(unittest.makeSuite(HomelandTestCase, 'test_net'))
00034 return suite
00035
00036 def all():
00037 """Run all tests"""
00038 suite = ServiceTestSuite()
00039 suite.addTest(unittest.makeSuite(HomelandTestCase, 'test_'))
00040 return suite
00041
00042
00043 class HomelandTestCase(ServiceTestCase):
00044 """Test case for ZipCodeResolver Web service
00045 """
00046 name = "test_ThreatService"
00047 client_file_name = "Current_Homeland_Security_Threat_Level_client.py"
00048 types_file_name = "Current_Homeland_Security_Threat_Level_types.py"
00049 server_file_name = None
00050
00051 def __init__(self, methodName):
00052 ServiceTestCase.__init__(self, methodName)
00053 self.wsdl2py_args.append('-b')
00054
00055 def test_net_threatLevel(self):
00056 loc = self.client_module.Current_Homeland_Security_Threat_LevelLocator()
00057 port = loc.getthreat_cfc(**self.getPortKWArgs())
00058
00059 msg = self.client_module.threatLevelRequest()
00060 rsp = port.threatLevel(msg)
00061 for item in rsp.ThreatLevelReturn.Item:
00062 item.Key
00063 item.Value
00064
00065
00066
00067 if __name__ == "__main__" :
00068 main()