Merge "Fixes py3 unit tests for nova.tests.unit.test_block_device.*"

This commit is contained in:
Jenkins 2016-06-10 15:04:38 +00:00 committed by Gerrit Code Review
commit f5aafb3dbf
2 changed files with 5 additions and 4 deletions

View File

@ -121,7 +121,8 @@ class BlockDeviceTestCase(test.NoDBTestCase):
{'virtual': 'ephemeral2', 'device': '/dev/sde'}]
prepended = block_device.mappings_prepend_dev(mapping)
self.assertEqual(expected.sort(), prepended.sort())
self.assertEqual(sorted(expected, key=lambda v: v['virtual']),
sorted(prepended, key=lambda v: v['virtual']))
def test_strip_dev(self):
self.assertEqual('sda', block_device.strip_dev('/dev/sda'))
@ -500,7 +501,9 @@ class TestBlockDeviceDict(test.NoDBTestCase):
return [bdm for bdm in bdms if bdm['source_type'] == 'image']
def _get_bootable_bdms(bdms):
return [bdm for bdm in bdms if bdm['boot_index'] >= 0]
return [bdm for bdm in bdms
if (bdm['boot_index'] is not None and
bdm['boot_index'] >= 0)]
new_no_img = block_device.from_legacy_mapping(self.legacy_mapping)
self.assertEqual(0, len(_get_image_bdms(new_no_img)))

View File

@ -84,8 +84,6 @@ nova.tests.unit.pci.test_stats.PciDeviceStatsTestCase
nova.tests.unit.pci.test_stats.PciDeviceStatsWithTagsTestCase
nova.tests.unit.test_api_validation.Base64TestCase
nova.tests.unit.test_bdm.BlockDeviceMappingEc2CloudTestCase
nova.tests.unit.test_block_device.BlockDeviceTestCase
nova.tests.unit.test_block_device.TestBlockDeviceDict
nova.tests.unit.test_cinder.CinderTestCase
nova.tests.unit.test_cinder.CinderV2TestCase
nova.tests.unit.test_configdrive2.ConfigDriveTestCase