A fork of https://github.com/Synerty/SOAPpy-py3 This is a working tree till fixes get imported upstream.
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.
 
 
 
 

72 lines
2.1 KiB

  1. #!/usr/bin/python2
  2. #standard imports
  3. import syslog, sys
  4. #domain specific imports
  5. sys.path.insert (1, '..')
  6. import SOAPpy
  7. SOAPpy.Config.simplify_objects=1
  8. ## def test_integer(self,pass_integer):
  9. ## def test_string(self,pass_string):
  10. ## def test_float(self,pass_float):
  11. ## def test_tuple(self,pass_tuple):
  12. ## def test_list(self,pass_list):
  13. ## def test_dictionary(self,pass_dictionary):
  14. if __name__ == "__main__":
  15. server = SOAPpy.SOAPProxy("http://localhost:9999")
  16. original_integer = 5
  17. result_integer = server.test_integer(original_integer)
  18. print("original_integer %s" % original_integer)
  19. print("result_integer %s" % result_integer)
  20. assert(result_integer==original_integer)
  21. print()
  22. original_string = "five"
  23. result_string = server.test_string(original_string)
  24. print("original_string %s" % original_string)
  25. print("result_string %s" % result_string)
  26. assert(result_string==original_string)
  27. print()
  28. original_float = 5.0
  29. result_float = server.test_float(original_float)
  30. print("original_float %s" % original_float)
  31. print("result_float %s" % result_float)
  32. assert(result_float==original_float)
  33. print()
  34. original_tuple = (1,2,"three","four",5)
  35. result_tuple = server.test_tuple(original_tuple)
  36. print("original_tuple %s" % str(original_tuple))
  37. print("result_tuple %s" % str(result_tuple))
  38. assert(tuple(result_tuple)==original_tuple)
  39. print()
  40. original_list = [5,4,"three",2,1]
  41. result_list = server.test_list(original_list)
  42. print("original_list %s" % original_list)
  43. print("result_list %s" % result_list)
  44. assert(result_list==original_list)
  45. print()
  46. original_dictionary = {
  47. 'one': 1,
  48. "two": 2,
  49. "three": 3,
  50. "four": 4,
  51. "five": 5,
  52. }
  53. result_dictionary = server.test_dictionary(original_dictionary)
  54. print("original_dictionary %s" % original_dictionary)
  55. print("result_dictionary %s" % result_dictionary)
  56. assert(result_dictionary==original_dictionary)
  57. print()
  58. server.quit()