[asterisk-commits] twilson: testsuite/asterisk/trunk r225 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 15 10:54:43 CDT 2010


Author: twilson
Date: Thu Apr 15 10:54:42 2010
New Revision: 225

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=225
Log:
allow regular expression matching in CDR tests

Modified:
    asterisk/trunk/lib/python/asterisk/cdr.py

Modified: asterisk/trunk/lib/python/asterisk/cdr.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/cdr.py?view=diff&rev=225&r1=224&r2=225
==============================================================================
--- asterisk/trunk/lib/python/asterisk/cdr.py (original)
+++ asterisk/trunk/lib/python/asterisk/cdr.py Thu Apr 15 10:54:42 2010
@@ -13,6 +13,7 @@
 import unittest
 import sys
 import csv
+import re
 
 class AsteriskCSVCDRLine:
     "A single Asterisk call detail record"
@@ -43,7 +44,8 @@
         """
 
         for k,v in self.iteritems():
-            if None not in (v, other.get(k)) and str(v).lower() != str(other.get(k)).lower():
+            if None not in (v, other.get(k)) and not re.search(
+                    str(v).lower(), str(other.get(k)).lower()):
                 print "CDR MATCH FAILED, Expected: %s:%s Got: %s:%s" % (k, v,
                         k, other.get(k))
                 return False




More information about the asterisk-commits mailing list