开发者

cherrypy when to know that the server has started

开发者 https://www.devze.com 2023-01-02 07:50 出处:网络
I am trying to write some unit tests for a small web service written with Cherrypy and I am wondering what\'s the best way to figure out that the server ha开发者_JAVA技巧s started, so i don\'t get con

I am trying to write some unit tests for a small web service written with Cherrypy and I am wondering what's the best way to figure out that the server ha开发者_JAVA技巧s started, so i don't get connection refused if I try to connect too early to the service ?


I got it figured out:

cherrypy.engine.start(); cherrypy.server.wait() it's the way to go.

Otherwise, I think you can get away with some tricks with cherrypy.server.bus.states

0

精彩评论

暂无评论...
验证码 换一张
取 消