[TIP] Capture HTTP traffic

C. Titus Brown ctb at msu.edu
Fri Nov 5 06:09:39 PDT 2010


On Fri, Nov 05, 2010 at 08:38:25AM -0400, Alfredo Deza wrote:
> On Fri, Nov 5, 2010 at 4:52 AM, Alex <alex.lavoro.propio at gmail.com> wrote:
> > 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 think no one has mentioned it in this thread, but to test our application
> we use
> TestApp [1] from WebTest [2] (by Ian Bicking) which covers most of what you
> mention.
> 
> All requests are captured, and you can evaluate any parts of the response.
> 
> We hook WebTest into the setUp method and we get full isolation from
> other tests that are running, we even got py.test to run in parallel with
> this same method achieving total isolation from other tests.

Hi Alfredo,

Alex has specified his problem in such a way that WebTest can't solve it,
unless I'm missing something... WebTest is another Python-specific solution,
based around WSGI, right?

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



More information about the testing-in-python mailing list