在config,我引用,
port
Required? No, defaults is “80”
Defines the port number to use for
executing requests, e.g. “8080”.
编辑:用户澄清他们的意思是this webtest(pythonpaste),而不是广泛使用的Canoo应用程序.我不会猜到,因为pythonpaste的webtest是一个非常不同的鱼,我引用…:
With this you can test your web
applications without starting an HTTP
server, and without poking into the
web framework shortcutting pieces of
your application that need to be
tested. The tests WebTest runs are
entirely equivalent to how a WSGI HTTP
server would call an application
没有启动HTTP服务器,没有“端口”的概念 – 在WSGI级别的进程中运行,没有实际的TCP / IP和HTTP.因此,“应用程序”不会侦听端口8080(或任何其他端口),而是直接调用其WSGI入口点,“就好像”HTTP服务器正在调用它们一样.
如果你想测试一个实际运行的HTTP服务器,那么你需要Canoo的webtest(或其他等效的框架),而不是pythonpaste – 后者将通过避免任何套接字层和HTTP层开销来实现更快的测试,但你可以’以这种方式测试一个单独的,现有的,运行的服务器(例如GAE的SDK).