<br><br><div class="gmail_quote">On Fri, Nov 5, 2010 at 4:52 AM, Alex <span dir="ltr">&lt;<a href="mailto:alex.lavoro.propio@gmail.com">alex.lavoro.propio@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Being the test target is a C++ application (or whichever foreign<br>
language the access to source code is not available), we first exclude<br>
Pythonic http libraries.<br>
<br>
I prefer not to hijack host configuration, use a proxy, or mock the<br>
server, since they either result in a lot of work, and difficult to be<br>
deployed in a CI server like Hudson, in which the test are not only<br>
run automatically, but the &quot;setup&quot; (hijack host file) and &quot;restore&quot; of<br>
the test environment is also preferably done automatically.<br>
<br></blockquote><div>We use Turbogears (based on Pylons) at work and we faced similar issues as the ones you</div><div>are describing.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

The best solution would be a high-level (HTTP-level) Python<br>
module/wrapper for &#39;pycap&#39;, which operates in &#39;packet&#39; 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&#39;ve just describe. Please<br>
correct if I am wrong.<br>
<font color="#888888"><br></font></blockquote><div><br></div><div>I think no one has mentioned it in this thread, but to test our application we use </div><div>TestApp [1] from WebTest [2] (by Ian Bicking) which covers most of what you mention.</div>
<div><br></div><div>All requests are captured, and you can evaluate any parts of the response.</div><div><br></div><div>We hook WebTest into the setUp method and we get full isolation from</div><div>other tests that are running, we even got py.test to run in parallel with</div>
<div>this same method achieving total isolation from other tests.</div><div><br></div><div>[1]  <a href="http://blog.ianbicking.org/2010/04/02/webtest-http-testing/">http://blog.ianbicking.org/2010/04/02/webtest-http-testing/</a></div>
<div>[2]  <a href="http://pythonpaste.org/webtest/class-webtest.TestApp.html">http://pythonpaste.org/webtest/class-webtest.TestApp.html</a></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font color="#888888">
Alex.<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
testing-in-python mailing list<br>
<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
<a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
</div></div></blockquote></div><br>