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.
 
 
 
 

44 lines
839 B

  1. """
  2. Check handing of unicode.
  3. """
  4. import sys
  5. sys.path.insert(1, "..")
  6. from SOAPpy import *
  7. # Uncomment to see outgoing HTTP headers and SOAP and incoming
  8. #Config.debug = 1
  9. #Config.dumpHeadersIn = 1
  10. #Config.dumpSOAPIn = 1
  11. #Config.dumpSOAPOut = 1
  12. # ask for returned SOAP responses to be converted to basic python types
  13. Config.simplify_objects = 0
  14. #Config.BuildWithNoType = 1
  15. #Config.BuildWithNoNamespacePrefix = 1
  16. server = SOAPProxy("http://localhost:9900/")
  17. x = u'uMOO' # Single unicode string
  18. y = server.echo_simple((x,))
  19. assert( x==y[0] )
  20. x = [u'uMoo1',u'uMoo2'] # array of unicode strings
  21. y = server.echo_simple(x)
  22. assert( x[0] == y[0] )
  23. assert( x[1] == y[1] )
  24. x = {
  25. u'A':1,
  26. u'B':u'B',
  27. 'C':u'C',
  28. 'D':'D'
  29. }
  30. y = server.echo_simple(x)
  31. for key in x.keys():
  32. assert( x[key] == y[0][key] )
  33. print "Success"