[asterisk-dev] [Code Review] A python AsteriskCSVCDR library for testing csv cdrs

Godson Gera godson.g at gmail.com
Mon Apr 5 07:33:48 CDT 2010


Hi,

Any specific reason for not using the csv module of python that ships with
standard library itself ? I use it whenever I have to parse or write cdr csv
file.

import csv
cdrfields=['accountcode', 'src', 'dst', 'dcontext', 'clid', 'channel',
'dstchannel', 'lastapp', 'lastdata', 'start', 'answer', 'end', 'duration',
'billsec', 'disposition', 'amaflags', 'uniqueid', 'userfield']
cdr = csv.DictReader(open('Master.csv'), cdrfields, '', '')

http://docs.python.org/library/csv.html


On Sat, Apr 3, 2010 at 4:29 AM, Terry Wilson <twilson at digium.com> wrote:

>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/605/
> -----------------------------------------------------------
>
> Review request for Asterisk Developers and Russell Bryant.
>
>
> Summary
> -------
>
> This is a library that adds the ability to test the CDRs that are generated
> during a test.  It can read a list of CDRs in from cdr-csv file, and test
> that the fields match some given input.
>
> I have also added CDR parsing to the iax-basic-call test. I'll correct the
> trailing whitespace that I see that crept in. :-)
>
>
> Diffs
> -----
>
>  /asterisk/trunk/lib/python/asterisk/cdr.py PRE-CREATION
>  /asterisk/trunk/lib/python/asterisk/self_test/Master.csv PRE-CREATION
>  /asterisk/trunk/lib/python/asterisk/self_test/Master2.csv PRE-CREATION
>  /asterisk/trunk/tests/iax-call-basic/run-test 171
>
> Diff: https://reviewboard.asterisk.org/r/605/diff
>
>
> Testing
> -------
>
> There is some internal testing done and I have run the iax-basic-call test
> and verified that it works on trunk and branches/1.4. On 1.4.26.2, the
> iax-basic-call test fails because no Master.csv file is created for some
> reason.
>
>
> Thanks,
>
> Terry
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>



-- 
Thanks & Regards,
Godson Gera
http://godson.in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20100405/7172cfd1/attachment-0001.htm 


More information about the asterisk-dev mailing list