我可以找到way to call the test harness,但我不知道如何编写简单的测试用例。谢谢。
发布于 2011-09-15 02:16:06
好吧,我得到了一个简单的测试用例,但由于我们使用的是非标准路由方法,我发现我必须为每个测试用例显式地重新初始化全局cherrypy配置(在testharness错误地重新初始化它之后)。这就是它:
“测试测试工具是否正常工作。”
import test_assignment_web
from cherrypy.test import helper
import cherrypy
class testTestHarness(helper.CPWebCase):
def setUp(self):
# fix up the cherrypy tree...
test_assignment_web.setUp()
def testTestPage(self):
path = "/test"
self.getPage(path)
self.assertStatus('200 OK')test_assignment_web.setUp()修复了cherrypy "tree“对象,使其在testharness破坏后可以工作。此测试用例适用于问题中给出的链接中描述的TestHarness。
https://stackoverflow.com/questions/7417701
复制相似问题