Fixes cells py3 unit tests

Enables cells unit tests for gate-nova-python34.

Partially Implements: blueprint nova-python3-mitaka

Change-Id: If5ccd02ec2bafdeafe2784d55b9db6667d2b89f5
This commit is contained in:
Claudiu Belu 2015-12-10 02:53:12 +02:00
parent 5fe5ceea48
commit e36e0876fb
3 changed files with 4 additions and 10 deletions

View File

@ -347,12 +347,12 @@ class CellStateManager(base.Base):
@sync_before
def get_child_cells(self):
"""Return list of child cell_infos."""
return self.child_cells.values()
return list(self.child_cells.values())
@sync_before
def get_parent_cells(self):
"""Return list of parent cell_infos."""
return self.parent_cells.values()
return list(self.parent_cells.values())
@sync_before
def get_parent_cell(self, cell_name):

View File

@ -116,7 +116,7 @@ class TestCellsStateManager(test.NoDBTestCase):
@mock.patch.object(utils, 'read_cached_file')
def test_filemanager_returned(self, mock_read_cached_file, mock_find_file):
mock_find_file.return_value = "/etc/nova/cells.json"
mock_read_cached_file.return_value = (False, six.StringIO({}))
mock_read_cached_file.return_value = (False, six.StringIO('{}'))
self.flags(cells_config='cells.json', group='cells')
manager = state.CellStateManager()
self.assertIsInstance(manager,
@ -145,7 +145,7 @@ class TestCellsStateManager(test.NoDBTestCase):
self.assertEqual(0, cap['ram_free']['units_by_mb']['0'])
self.assertEqual(0, cap['disk_free']['units_by_mb']['0'])
units = cell_free_ram / 50
units = cell_free_ram // 50
self.assertEqual(units, cap['ram_free']['units_by_mb']['50'])
sz = 25 * 1024

View File

@ -64,12 +64,6 @@ nova.tests.unit.api.openstack.compute.test_volumes.VolumeApiTestV21
nova.tests.unit.api.test_compute_req_id.RequestIdTest
nova.tests.unit.api.test_validator.ValidatorTestCase
nova.tests.unit.api.test_wsgi.Test
nova.tests.unit.cells.test_cells_messaging.CellsBroadcastMethodsTestCase
nova.tests.unit.cells.test_cells_messaging.CellsMessageClassesTestCase
nova.tests.unit.cells.test_cells_scheduler.CellsSchedulerTestCase
nova.tests.unit.cells.test_cells_state_manager.TestCellsGetCapacity
nova.tests.unit.cells.test_cells_state_manager.TestCellsStateManager
nova.tests.unit.cells.test_cells_state_manager.TestCellsStateManagerNToOne
nova.tests.unit.compute.test_compute.ComputeAPITestCase.test_create_with_base64_user_data
nova.tests.unit.compute.test_compute.ComputeInjectedFilesTestCase.test_injected_invalid
nova.tests.unit.compute.test_compute.ComputeTestCase.test_finish_resize_with_volumes