[TIP] vcr

vanderson.mota at gmail.com vanderson.mota at gmail.com
Tue Mar 27 09:13:26 PDT 2012


Yes it should be feasible, and true it seems that the Ruby community has
much more ferment in this area.

Anyway it would be great to do the same thing recording directly the TCP/IP
streams.
There are probably a few problems with that:
1. need to be root to sniff the network traffic
2. might need to rewrite a lot of packets when replaying because they
depend on the specific
   network configuration of the machine

so maybe it's not really easy after all, what do you think?

Yup, also recording TCP intereaction will make things a lot more difficult.
When you replay the http interactions, you only need to use the url, the
headers and the body as key to find the recorded response(i guess).

2012/3/27 Andrea Crotti <andrea.crotti.0 at gmail.com>

> On 03/27/2012 02:24 PM, vanderson.mota at gmail.com wrote:
>
>> VCR, as far as i know only works for HTTP. It is very easy to use, and
>> unfortunately i didn't find a match for it in python. It seems people are
>> more concerned about building "My new cool ruby-like test runner".
>>
>> The coding strategy to make VCR was to monkeypatch the Http Libraries,
>> like the basic Net::Http, since there are a lot of http clients use it
>> under the hood. And for the ones who don't, the author wrote an adapter for
>> the most popular ones[1].
>>
>> I think similar approach can be used with python.
>>
>> 1: https://github.com/**myronmarston/vcr/tree/master/**
>> lib/vcr/library_hooks<https://github.com/myronmarston/vcr/tree/master/lib/vcr/library_hooks>
>>
>
>
> Yes it should be feasible, and true it seems that the Ruby community has
> much more ferment in this area.
>
> Anyway it would be great to do the same thing recording directly the
> TCP/IP streams.
> There are probably a few problems with that:
> 1. need to be root to sniff the network traffic
> 2. might need to rewrite a lot of packets when replaying because they
> depend on the specific
>    network configuration of the machine
>
> so maybe it's not really easy after all, what do you think?
>



-- 
Vanderson Mota dos Santos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20120327/e2bfd3d9/attachment.htm>


More information about the testing-in-python mailing list