Use assertFalse insead of failIf since failIf is deprecated in python 3.2.
authorZac Medico <zmedico@gentoo.org>
Sun, 11 Apr 2010 23:16:01 +0000 (16:16 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 11 Apr 2010 23:16:01 +0000 (16:16 -0700)
pym/portage/tests/util/test_uniqueArray.py
pym/portage/tests/util/test_varExpand.py
pym/portage/tests/versions/test_vercmp.py

index 34daaf23c46b8c04aeaf764c8b2e875ea01b75bf..2a1a209298a6e144c70a97246a28ec19e683f57e 100644 (file)
@@ -20,5 +20,5 @@ class UniqueArrayTestCase(TestCase):
                        result = unique_array( test[0] )
                        for item in test[1]:
                                number = result.count(item)
-                               self.failIf( number is not 1, msg="%s contains %s of %s, \
+                               self.assertFalse( number is not 1, msg="%s contains %s of %s, \
                                        should be only 1" % (result, number, item) )
index 1c2500dbda52ab5643f5798693c02b0b03baef05..30aa390bff952506873e2a4bd68679b99445863f 100644 (file)
@@ -13,11 +13,11 @@ class VarExpandTestCase(TestCase):
                for key in varDict:
                        result = varexpand( "$%s" % key, varDict )
                        
-                       self.failIf( result != varDict[key],
+                       self.assertFalse( result != varDict[key],
                                msg="Got %s != %s, from varexpand( %s, %s )" % \
                                        ( result, varDict[key], "$%s" % key, varDict ) )
                        result = varexpand( "${%s}" % key, varDict )
-                       self.failIf( result != varDict[key],
+                       self.assertFalse( result != varDict[key],
                                msg="Got %s != %s, from varexpand( %s, %s )" % \
                                        ( result, varDict[key], "${%s}" % key, varDict ) )
 
@@ -27,7 +27,7 @@ class VarExpandTestCase(TestCase):
                tests = [ ("\"${a}\"", "\"5\"") ]
                for test in tests:
                        result = varexpand( test[0], varDict )
-                       self.failIf( result != test[1],
+                       self.assertFalse( result != test[1],
                                msg="Got %s != %s from varexpand( %s, %s )" \
                                % ( result, test[1], test[0], varDict ) )
 
@@ -37,7 +37,7 @@ class VarExpandTestCase(TestCase):
                tests = [ ("\'${a}\'", "\'${a}\'") ]
                for test in tests:
                        result = varexpand( test[0], varDict )
-                       self.failIf( result != test[1],
+                       self.assertFalse( result != test[1],
                                msg="Got %s != %s from varexpand( %s, %s )" \
                                % ( result, test[1], test[0], varDict ) )
 
@@ -49,11 +49,11 @@ class VarExpandTestCase(TestCase):
 
                for var in testVars:
                        result = varexpand( "$%s" % var, varDict )
-                       self.failIf( len(result),
+                       self.assertFalse( len(result),
                                msg="Got %s == %s, from varexpand( %s, %s )" \
                                        % ( result, var, "$%s" % var, varDict ) )
 
                        result = varexpand( "${%s}" % var, varDict )
-                       self.failIf( len(result),
+                       self.assertFalse( len(result),
                                msg="Got %s == %s, from varexpand( %s, %s )" \
                                        % ( result, var, "${%s}" % var, varDict ) )
index 23e7dd57537b60a01ad013a3780e42f95d3fa54a..aa7969ce88ab3c857b4ef0bb9ec056bb170e5bd8 100644 (file)
@@ -24,7 +24,7 @@ class VerCmpTestCase(TestCase):
                        ("12.2.5", "12.2b"),
                ]
                for test in tests:
-                       self.failIf( vercmp( test[0], test[1] ) <= 0, msg="%s < %s? Wrong!" % (test[0],test[1]) )
+                       self.assertFalse( vercmp( test[0], test[1] ) <= 0, msg="%s < %s? Wrong!" % (test[0],test[1]) )
 
        def testVerCmpLess(self):
                """
@@ -47,7 +47,7 @@ class VerCmpTestCase(TestCase):
                        ("12.2b", "12.2.5"),
                ]
                for test in tests:
-                       self.failIf( vercmp( test[0], test[1]) >= 0, msg="%s > %s? Wrong!" % (test[0],test[1]))
+                       self.assertFalse( vercmp( test[0], test[1]) >= 0, msg="%s > %s? Wrong!" % (test[0],test[1]))
        
        
        def testVerCmpEqual(self):
@@ -59,7 +59,7 @@ class VerCmpTestCase(TestCase):
                        ("1.0-r0", "1.0-r0"),
                        ("1.0-r1", "1.0-r1")]
                for test in tests:
-                       self.failIf( vercmp( test[0], test[1]) != 0, msg="%s != %s? Wrong!" % (test[0],test[1]))
+                       self.assertFalse( vercmp( test[0], test[1]) != 0, msg="%s != %s? Wrong!" % (test[0],test[1]))
                        
        def testVerNotEqual(self):
                
@@ -77,4 +77,4 @@ class VerCmpTestCase(TestCase):
                        ("12.2b", "12.2"),
                ]
                for test in tests:
-                       self.failIf( vercmp( test[0], test[1]) == 0, msg="%s == %s? Wrong!" % (test[0],test[1]))
+                       self.assertFalse( vercmp( test[0], test[1]) == 0, msg="%s == %s? Wrong!" % (test[0],test[1]))