<br><br><div class="gmail_quote">On Fri, Nov 5, 2010 at 9:09 AM, C. Titus Brown <span dir="ltr"><<a href="mailto:ctb@msu.edu">ctb@msu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, Nov 05, 2010 at 08:38:25AM -0400, Alfredo Deza wrote:<br>
> On Fri, Nov 5, 2010 at 4:52 AM, Alex <<a href="mailto:alex.lavoro.propio@gmail.com">alex.lavoro.propio@gmail.com</a>> wrote:<br>
</div><div class="im">> > The best solution would be a high-level (HTTP-level) Python<br>
> > module/wrapper for 'pycap', which operates in 'packet' level. This<br>
> > said module use pycap to capture and filter HTTP requests and returns<br>
> > the result in a more Pythonic data structures. This module should<br>
> > start a thread which captures HTTP requests while the test case is<br>
> > being executed.<br>
> ><br>
> > I cannot find anything which does what I've just describe. Please<br>
> > correct if I am wrong.<br>
> ><br>
> ><br>
> I think no one has mentioned it in this thread, but to test our application<br>
> we use<br>
> TestApp [1] from WebTest [2] (by Ian Bicking) which covers most of what you<br>
> mention.<br>
><br>
> All requests are captured, and you can evaluate any parts of the response.<br>
><br>
> We hook WebTest into the setUp method and we get full isolation from<br>
> other tests that are running, we even got py.test to run in parallel with<br>
> this same method achieving total isolation from other tests.<br>
<br>
</div>Hi Alfredo,<br>
<br>
Alex has specified his problem in such a way that WebTest can't solve it,<br>
unless I'm missing something... WebTest is another Python-specific solution,<br>
based around WSGI, right?<br>
<br></blockquote><div>Yes WebTest is based around WSGi but as I understood it, Alex mentioned:</div><div><br></div><div>"<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">The target to be tested is a C++ application, so Python tools like</span></div>
<meta charset="utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">wsgi_intercept, twill, mechanize do not apply."</span></div><div class="gmail_quote">
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div class="gmail_quote"><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Which doesn't apply (correct me if I am wrong) to a WSGI application wrapped </span></font></div>
<div class="gmail_quote"><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">around WebTest. </span></font></div><div class="gmail_quote"><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></font></div><div class="gmail_quote"><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">I just don't </span></font><span class="Apple-style-span" style="font-family: arial, sans-serif; border-collapse: collapse; ">see how a C++ app would not be able to call it so he can record </span></div>
<div class="gmail_quote"><span class="Apple-style-span" style="font-family: arial, sans-serif; border-collapse: collapse; "><br></span></div><div class="gmail_quote"><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">For example, when we test external API's that do not have a sandbox and we </span></font></div>
<div class="gmail_quote"><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">need to make HTTP calls that return certain responses, we create something </span></font></div>
<div class="gmail_quote"><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">similar to a WSGI app (in some cases we use Bottle) </span></font><span class="Apple-style-span" style="font-family: arial, sans-serif; border-collapse: collapse; ">that has WebTest around </span></div>
<div class="gmail_quote"><span class="Apple-style-span" style="font-family: arial, sans-serif; border-collapse: collapse; ">it, calls and responses are captured no matter </span><span class="Apple-style-span" style="font-family: arial, sans-serif; border-collapse: collapse; ">where you are starting the call from.</span></div>
<div class="gmail_quote"><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div class="gmail_quote"><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">But then again, I might be wrong applying those solutions to Alex's problem :)</span></font></div>
<div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
best,<br>
--titus<br>
<font color="#888888">--<br>
</font><div><div></div><div class="h5">C. Titus Brown, <a href="mailto:ctb@msu.edu">ctb@msu.edu</a><br>
</div></div></blockquote></div><br>