Make the tests pass.
authorZac Medico <zmedico@gentoo.org>
Wed, 10 Jan 2007 12:50:49 +0000 (12:50 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 10 Jan 2007 12:50:49 +0000 (12:50 -0000)
svn path=/main/trunk/; revision=5523

tests/test_atoms.py

index 499920f2182be3ab087b22ba9994ffd6a3ddcee3..119b1fb3ca284a7369c26c60d9241ce396f496fd 100644 (file)
@@ -21,23 +21,15 @@ class AtomCmpEqualGlob(TestCase):
 #                        ("=sys-fs/udev_cvs*","sys-fs/udev_cvs_pre4" ) ]
 
                for test in tests:
-                       try:
-                               self.failIf( len(match_from_list( test[0], test[1] )) < 1,
-                                       msg="%s should match %s!" % (test[0], test[1]) )
-                       except TypeError:
-                               print "%s should match %s!" % (test[0], test[1])
-                               raise
+                       self.failIf( len(match_from_list( test[0], [test[1]] )) != 1,
+                               msg="%s should match %s!" % (test[0], test[1]) )
 
        def testEqualGlobFail(self):
-               tests = [ ("=sys-apps/portage*", "sys-apps/portage-2.1" ),
-                         ("=sys-apps/portage-*", "sys-apps/portage-2.1" ) ]
+               tests = [ ("=sys-apps/portage-2*", "sys-apps/portage-2.1" ),
+                         ("=sys-apps/portage-2.1*", "sys-apps/portage-2.1.2" ) ]
                for test in tests:
-                       try:
-                               self.failIf( len( match_from_list( test[0], test[1] ) ),
-                                       msg="%s should match %s!" % (test[0], test[1]) )
-                       except TypeError:
-                               #TypeError means it died parsing, this is OK
-                               pass
+                       self.failIf( len( match_from_list( test[0], [test[1]] ) ) != 1,
+                               msg="%s should match %s!" % (test[0], test[1]) )
 
 class VerCmpTestCase(TestCase):
        """ A simple testCase for portage_versions.vercmp()