On 02/28/2012 09:55 PM, Vinson Lee wrote: > This patch substitutes out TestCase methods that were introduced with > Python 2.7 with TestCase.assertTrue. > > Fixes unittest_suite failures on Ubuntu 10.04 (Python 2.6.5).
Great work, applied, thanks: https://github.com/autotest/autotest/commit/f37ad03c372cdae1cb080a10efb77e9b51802a9a > Signed-off-by: Vinson Lee<[email protected]> > --- > client/virt/installer_unittest.py | 8 ++++---- > client/virt/virt_utils_unittest.py | 2 +- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/client/virt/installer_unittest.py > b/client/virt/installer_unittest.py > index 64b1b89..475b448 100755 > --- a/client/virt/installer_unittest.py > +++ b/client/virt/installer_unittest.py > @@ -20,7 +20,7 @@ class installer_test(unittest.TestCase): > > self.registry.register(install_mode, CustomVirtInstaller, virt_type) > klass = self.registry.get_installer(install_mode, virt_type) > - self.assertIs(klass, CustomVirtInstaller) > + self.assertTrue(klass is CustomVirtInstaller) > > > def test_register_get_installer_default(self): > @@ -32,12 +32,12 @@ class installer_test(unittest.TestCase): > self.registry.register(install_mode, BaseVirtInstaller) > klass = self.registry.get_installer(install_mode, > get_default_virt=True) > - self.assertIs(klass, BaseVirtInstaller) > + self.assertTrue(klass is BaseVirtInstaller) > > klass = self.registry.get_installer(install_mode, > virt=None, > get_default_virt=True) > - self.assertIs(klass, BaseVirtInstaller) > + self.assertTrue(klass is BaseVirtInstaller) > > > def test_make_installer(self): > @@ -57,7 +57,7 @@ vm_type = test""" > params = config_parser.get_dicts().next() > > instance = installer.make_installer("test_install_mode_test", > params) > - self.assertIsInstance(instance, Installer) > + self.assertTrue(isinstance(instance, Installer)) > > > if __name__ == '__main__': > diff --git a/client/virt/virt_utils_unittest.py > b/client/virt/virt_utils_unittest.py > index a895ffd..cd0910c 100755 > --- a/client/virt/virt_utils_unittest.py > +++ b/client/virt/virt_utils_unittest.py > @@ -173,7 +173,7 @@ class TestNumaNode(unittest.TestCase): > self.assertEqual(self.numa_node.pin_cpu("1237"), "7") > self.assertEqual(self.numa_node.dict["7"], "1237") > > - self.assertNotIn("free", self.numa_node.dict.values()) > + self.assertTrue("free" not in self.numa_node.dict.values()) > > > def test_free_cpu(self): _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
