[TIP] Capture HTTP traffic

C. Titus Brown ctb at msu.edu
Fri Nov 5 06:05:34 PDT 2010


On Fri, Nov 05, 2010 at 09:52:49AM +0100, Alex wrote:
> Being the test target is a C++ application (or whichever foreign
> language the access to source code is not available), we first exclude
> Pythonic http libraries.
> 
> I prefer not to hijack host configuration, use a proxy, or mock the
> server, since they either result in a lot of work, and difficult to be
> deployed in a CI server like Hudson, in which the test are not only
> run automatically, but the "setup" (hijack host file) and "restore" of
> the test environment is also preferably done automatically.

Hi Alex,

this has not been my experience.  The proxy solution is quite easy to set up
and tear down.  Might be worth taking a second look.

> The best solution would be a high-level (HTTP-level) Python
> module/wrapper for 'pycap', which operates in 'packet' level. This
> said module use pycap to capture and filter HTTP requests and returns
> the result in a more Pythonic data structures. This module should
> start a thread which captures HTTP requests while the test case is
> being executed.
> 
> I cannot find anything which does what I've just describe. Please
> correct if I am wrong.

I don't know of anything like this, sorry.

best,
--titus
-- 
C. Titus Brown, ctb at msu.edu



More information about the testing-in-python mailing list