[Reportbug-commits] r688 - in trunk (3 files)

morph at users.alioth.debian.org morph at users.alioth.debian.org
Fri Jan 16 09:05:05 UTC 2009


    Date: Friday, January 16, 2009 @ 09:05:03
  Author: morph
Revision: 688

reportbug/test_hiermatch.py, test/test_hiermatch.py

* reportbug/test_hiermatch.py, test/test_hiermatch.py
  - removed reportbug/test_hiermatch.py, partially merget into
    test/test_hiermatch.py

Modified:
  trunk/debian/changelog
  trunk/test/test_hiermatch.py
Deleted:
  trunk/reportbug/test_hiermatch.py

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-01-15 20:07:37 UTC (rev 687)
+++ trunk/debian/changelog	2009-01-16 09:05:03 UTC (rev 688)
@@ -7,8 +7,11 @@
   * share/{handle_bugscript, presubj, reportbug.el, script}, setup.py
     - moved files installed in /usr/share/... into share/ to clean up top level
       directory
+  * reportbug/test_hiermatch.py, test/test_hiermatch.py
+    - removed reportbug/test_hiermatch.py, partially merget into
+      test/test_hiermatch.py
 
- -- Sandro Tosi <morph at debian.org>  Thu, 15 Jan 2009 13:19:44 +0100
+ -- Sandro Tosi <morph at debian.org>  Fri, 16 Jan 2009 10:01:29 +0100
 
 reportbug (3.99.1) experimental; urgency=low
 

Deleted: trunk/reportbug/test_hiermatch.py
===================================================================
--- trunk/reportbug/test_hiermatch.py	2009-01-15 20:07:37 UTC (rev 687)
+++ trunk/reportbug/test_hiermatch.py	2009-01-16 09:05:03 UTC (rev 688)
@@ -1,44 +0,0 @@
-# $Id: test_hiermatch.py,v 1.1.1.1 2004-02-05 04:29:08 lawrencc Exp $
-
-from reportbuglib import hiermatch as hier
-
-def test_list():
-    import sys
-    a = file(sys.argv[0]).readlines()
-    b = hier.grep_list(a, '\[.*\]')
-    for i in b:
-        print a[i].rstrip()
-    print '*'*40
-    c = hier.grep_list(a, 'print', b)
-    for i in c:
-        print a[i].rstrip()
-
-
-def test_hier():
-    import sys
-    a = file(sys.argv[0]).readlines()
-    b = [(1, a)]
-    c = hier.egrep_hierarchy(b, 'print', )
-    print c
-    for i in range(len(c)):
-        for k in c[i]:
-            print b[i][1][k].rstrip()
-    d = hier.egrep_hierarchy(b, '\[.*\]', c)
-    print d
-    for i in range(len(d)):
-        for k in d[i]:
-            print b[i][1][k].rstrip()
-
-def test_mhier():
-    import sys
-    a = file(sys.argv[0]).readlines()
-    b = [(1, a)]
-    c = hier.matched_hierarchy(b, 'print', )
-    print c
-    d = [len(i[1]) for i in c]
-    print reduce(lambda x, y: x+y, d)
-
-test_mhier()
-
-# vim:ts=8:sw=4:expandtab:
-

Modified: trunk/test/test_hiermatch.py
===================================================================
--- trunk/test/test_hiermatch.py	2009-01-15 20:07:37 UTC (rev 687)
+++ trunk/test/test_hiermatch.py	2009-01-16 09:05:03 UTC (rev 688)
@@ -12,5 +12,21 @@
 """
 
 import scaffold
+from scaffold import TestCase
 
 from reportbug import hiermatch
+
+test_strings_list = ['Beautiful is better than ugly.',
+                     'Explicit is better than implicit.',
+                     'Simple is better than complex.',
+                     'Complex is better than complicated.']
+
+
+class Test_egrep_list(TestCase):
+    """Test cases for 'egrep_list' """
+
+    def test_it_works(self):
+        """ Should return '4' matches """
+        counts = hiermatch.egrep_list(test_strings_list, 'better')
+        
+        self.failUnlessEqual(len(counts), 4, "Not 4 matches")




More information about the Reportbug-commits mailing list