|
2#
楼主 |
发表于 2007-5-21 12:01:52
|
只看该作者
语法错误吗?
是不是记录的脚本中要自己添加些语句?
这是前几行教本记录,谁能帮我看看什么问题啊?多谢了~
# Generated by MaxQ [com.bitmechanic.maxq.generator.JythonCodeGenerator]
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 1(PyHttpTestCase):
def runTest(self):
self.msg('Test started')
self.msg("Testing URL: %s" % self.replaceURL('''http://hdgis.ncgc.com.cn/webgis/pages/images/gis2_26.gif'''))
url = "http://hdgis.ncgc.com.cn/webgis/pages/images/gis2_26.gif"
params = None
Validator.validateRequest(self, self.getMethod(), "get", url, params)
self.get(url, params)
self.msg("Testing URL: %s" % self.replaceURL('''http://hdgis.ncgc.com.cn/webgis/pages/images/gis2_22.gif'''))
url = "http://hdgis.ncgc.com.cn/webgis/pages/images/gis2_22.gif"
params = None
Validator.validateRequest(self, self.getMethod(), "get", url, params)
self.get(url, params)
self.msg("Response code: %s" % self.getResponseCode())
self.assertEquals("Assert number 1 failed", 200, self.getResponseCode())
Validator.validateResponse(self, self.getMethod(), url, params) |
|