esj_test_client.py :  » Web-Services » SOAPpy » SOAPpy-0.12.0 » tests » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Web Services » SOAPpy 
SOAPpy » SOAPpy 0.12.0 » tests » esj_test_client.py
#!/usr/bin/python2

#standard imports
import syslog, sys

#domain specific imports
sys.path.insert (1, '..')
import SOAPpy

SOAPpy.Config.simplify_objects=1
 
##     def test_integer(self,pass_integer):
##     def test_string(self,pass_string):
##     def test_float(self,pass_float):
##     def test_tuple(self,pass_tuple):
##     def test_list(self,pass_list):
##     def test_dictionary(self,pass_dictionary):

if __name__ == "__main__":

    server = SOAPpy.SOAPProxy("http://localhost:9999")

    original_integer = 5
    result_integer = server.test_integer(original_integer)
    print "original_integer %s" % original_integer
    print "result_integer %s" % result_integer
    assert(result_integer==original_integer)
    print
    
    original_string = "five"
    result_string = server.test_string(original_string)
    print "original_string %s" % original_string
    print "result_string %s" % result_string
    assert(result_string==original_string)
    print
    
    original_float = 5.0
    result_float = server.test_float(original_float)
    print "original_float %s" % original_float
    print "result_float %s" % result_float
    assert(result_float==original_float)
    print
    
    original_tuple = (1,2,"three","four",5)
    result_tuple = server.test_tuple(original_tuple)
    print "original_tuple %s" % str(original_tuple)
    print "result_tuple %s" % str(result_tuple)
    assert(tuple(result_tuple)==original_tuple)
    print

    original_list = [5,4,"three",2,1]
    result_list = server.test_list(original_list)
    print "original_list %s" % original_list
    print "result_list %s" % result_list
    assert(result_list==original_list)
    print
    
    original_dictionary = {
        'one': 1,
        "two": 2,
        "three": 3,
        "four": 4,
        "five": 5,
        }
    result_dictionary = server.test_dictionary(original_dictionary)
    print "original_dictionary %s" % original_dictionary
    print "result_dictionary %s" % result_dictionary
    assert(result_dictionary==original_dictionary)
    print
    
    server.quit()
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.