[TIP] HTTP servers testing

Grig Gheorghiu grig at gheorghiu.net
Wed Feb 28 12:43:55 PST 2007


--- Kumar McMillan <kumar.mcmillan at gmail.com> wrote:

> it's still a limited use case (I'm testing that single, static
> responses get extracted properly from a service).  I imagine that
> installing an app would be a similar decorator tho, like:
> 
> @service.intercepted_by(my_wsgi_app)
> def test_get_something_from_service():
>     pass
> 
> I'll keep playing with it and see if it turns into something useful.
> the enable/disable thing is confusing but it's the only way I can
> figure out how to turn it into the real, non-intercepted staging
> service (for a buildbot test) without putting a stupid if statement
> in
> front of the decorator :D

One other way would be to use an environment variable, and then check
for an enable/disable flag if the env variable is not set.

Grig



More information about the testing-in-python mailing list