Merge "Fix misuse of assertTrue in console and virt tests"

This commit is contained in:
Jenkins
2016-02-26 01:10:52 +00:00
committed by Gerrit Code Review
4 changed files with 4 additions and 4 deletions

View File

@@ -92,7 +92,7 @@ class SerialTestCase(test.NoDBTestCase):
for port in six.moves.range(start, stop):
self.assertEqual(port, serial.acquire_port('127.0.0.2'))
self.assertTrue(10, len(serial.ALLOCATED_PORTS))
self.assertEqual(10, len(serial.ALLOCATED_PORTS))
@mock.patch('nova.console.serial._verify_port')
def test_acquire_port_in_use(self, fake_verify_port):

View File

@@ -296,7 +296,7 @@ class VirtDiskVFSGuestFSTest(test.NoDBTestCase):
vfs = vfsimpl.VFSGuestFS(self.rawfile)
vfs.setup()
self.assertIsNotNone(vfs.handle)
self.assertTrue('ext3', vfs.get_image_fs())
self.assertEqual('ext3', vfs.get_image_fs())
vfs.teardown()
@mock.patch.object(vfsimpl.VFSGuestFS, 'setup_os')

View File

@@ -107,7 +107,7 @@ class Os(object):
return new_list
def get_name(self):
self.name
return self.name
class DeviceList(object):

View File

@@ -42,7 +42,7 @@ class LibvirtOsInfoTest(test.NoDBTestCase):
def test_get_os(self):
os_info_db = osinfo._OsInfoDatabase.get_instance()
os_name = os_info_db.get_os('fedora22').get_name()
self.assertTrue('Fedora 22', os_name)
self.assertEqual('Fedora 22', os_name)
def test_get_os_fails(self):
os_info_db = osinfo._OsInfoDatabase.get_instance()