|
From: <bov...@us...> - 2006-11-01 22:31:34
|
Revision: 1290
http://svn.sourceforge.net/pywebsvcs/?rev=1290&view=rev
Author: boverhof
Date: 2006-11-01 14:31:30 -0800 (Wed, 01 Nov 2006)
Log Message:
-----------
couple changes to get unittest to work on windows, the test/wsdlpy dispatch tests still fail because windows doesn't understand #!/usr/bin/env python
Modified Paths:
--------------
trunk/zsi/ZSI/generate/commands.py
trunk/zsi/test/wsdl2py/ServiceTest.py
Modified: trunk/zsi/ZSI/generate/commands.py
===================================================================
--- trunk/zsi/ZSI/generate/commands.py 2006-10-30 23:49:33 UTC (rev 1289)
+++ trunk/zsi/ZSI/generate/commands.py 2006-11-01 22:31:30 UTC (rev 1290)
@@ -171,8 +171,9 @@
except Exception, e:
print "Error loading %s: \n\t%s" % (location, e)
# exit code UNIX specific, Windows?
- sys.exit(os.EX_NOINPUT)
-
+ if hasattr(os, 'EX_NOINPUT'): sys.exit(os.EX_NOINPUT)
+ sys.exit("error loading %s" %location)
+
if options.simple_naming:
# Use a different client suffix
WriteServiceModule.client_module_suffix = "_client"
Modified: trunk/zsi/test/wsdl2py/ServiceTest.py
===================================================================
--- trunk/zsi/test/wsdl2py/ServiceTest.py 2006-10-30 23:49:33 UTC (rev 1289)
+++ trunk/zsi/test/wsdl2py/ServiceTest.py 2006-11-01 22:31:30 UTC (rev 1290)
@@ -77,7 +77,11 @@
'''
host = CONFIG_PARSER.get(SECTION_DISPATCH, 'host')
port = CONFIG_PARSER.get(SECTION_DISPATCH, 'port')
- process = subprocess.Popen([cmd, port], env=ENVIRON)
+ try:
+ process = subprocess.Popen(['python %s' %cmd, port], env=ENVIRON)
+ except:
+ print >>sys.stderr, 'error executing: %s' %cmd
+ raise
time.sleep(1)
return process
@@ -281,7 +285,8 @@
exit = -1
#TODO: returncode WINDOWS?
- self.failUnless(os.WIFEXITED(exit),
+ WIF = hasattr(os, 'WIFEXITED')
+ if WIF: self.failUnless(os.WIFEXITED(exit),
'"%s" exited with signal#: %d' %(wsdl2py, exit))
self.failUnless(exit == 0,
'"%s" exited with exit status: %d' %(wsdl2py, exit))
@@ -296,7 +301,7 @@
warnings.warn("TODO: Not sure what is going on here?")
#TODO: returncode WINDOWS?
- self.failUnless(os.WIFEXITED(exit),
+ if WIF: self.failUnless(os.WIFEXITED(exit),
'"%s" exited with signal#: %d' %(wsdl2dispatch, exit))
self.failUnless(exit == 0,
'"%s" exited with exit status: %d' %(wsdl2dispatch, exit))
@@ -372,8 +377,11 @@
ServiceTestCase.CleanUp()
ServiceTestCase._lastToDispatch = expath
- ServiceTestCase._process = _LaunchContainer(TOPDIR + '/' + expath)
-
+ ServiceTestCase._process = \
+ _LaunchContainer(os.path.join(os.path.abspath(TOPDIR),
+ *expath.split('/')))
+
+
def CleanUp(cls):
"""call this when dispatch server is no longer needed,
maybe another needs to be started. Assumption that
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|