cannot import name .....
HMS Surprise
john at datavoiceint.com
Thu May 3 14:02:27 EDT 2007
Thanks for posting.
pythonpath = .;c:\maxq\bin\testScripts; c:\maxq\bin;c:\maxq\jython
Both files are in c:\maxq\bin\testScripts. Also I do not get the
message "no module named...:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
File nCreateIncident.py, the importer:
from PyHttpTestCase import PyHttpTestCase
from com.bitmechanic.maxq import Config
global validatorPkg
from nBaseTest import nBaseTest
# definition of test class
class nCreateIncident(nBaseTest):
def runTest(self):
self.msg('Test started')
self.logon()
# Code to load and run the test
if __name__ == 'main':
test = nCreateIncident("nCreateIncident")
test.Run()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
File nBaseTest
from PyHttpTestCase import PyHttpTestCase
from com.bitmechanic.maxq import Config
global validatorPkg
if __name__ == 'main':
validatorPkg = Config.getValidatorPkgName()
# Determine the validator for this testcase.
exec 'from '+validatorPkg+' import Validator'
# definition of test class
class nBaseTest(PyHttpTestCase):
def logon(self):
self.msg('Test started')
if __name__ == 'main':
t = nBaseTest('nBaseTest')
t.logon()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Best Regards,
jvh
More information about the Python-list
mailing list