Skip to content

Commit

Permalink
Fixes cells py3 unit tests
Browse files Browse the repository at this point in the history
Enables cells unit tests for gate-nova-python34.

Partially Implements: blueprint nova-python3-mitaka

Change-Id: If5ccd02ec2bafdeafe2784d55b9db6667d2b89f5
  • Loading branch information
claudiubelu committed Feb 9, 2016
1 parent 5fe5cee commit e36e087
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions nova/cells/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,12 @@ def get_my_state(self):
@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):
Expand Down
4 changes: 2 additions & 2 deletions nova/tests/unit/cells/test_cells_state_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_cells_config_not_found(self):
@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,
Expand Down Expand Up @@ -145,7 +145,7 @@ def test_capacity_no_reserve(self):
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
Expand Down
6 changes: 0 additions & 6 deletions tests-py3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e36e087

Please sign in to comment.