"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/tests/unit/api/v3/test_volumes.py" between
cinder-15.4.1.tar.gz and cinder-15.5.0.tar.gz

About: OpenStack Cinder (Core Service: Block Storage) provides persistent block storage to running instances. Its pluggable driver architecture facilitates the creation and management of block storage devices.
The "Train" series (maintained release).

test_volumes.py  (cinder-15.4.1):test_volumes.py  (cinder-15.5.0)
skipping to change at line 283 skipping to change at line 283
req.api_version_request = mv.get_api_version(mv.SUPPORT_COUNT_INFO) req.api_version_request = mv.get_api_version(mv.SUPPORT_COUNT_INFO)
ctxt = context.RequestContext(fake.USER_ID, fake.PROJECT_ID, True) ctxt = context.RequestContext(fake.USER_ID, fake.PROJECT_ID, True)
req.environ['cinder.context'] = ctxt req.environ['cinder.context'] = ctxt
res_dict = self.controller._get_volumes(req, is_detail=is_detail) res_dict = self.controller._get_volumes(req, is_detail=is_detail)
self.assertEqual(3, len(res_dict['volumes'])) self.assertEqual(3, len(res_dict['volumes']))
if show_count: if show_count:
self.assertEqual(3, res_dict['count']) self.assertEqual(3, res_dict['count'])
else: else:
self.assertNotIn('count', res_dict) self.assertNotIn('count', res_dict)
def test_list_volume_with_multiple_filters(self):
metadata = {'key_X': 'value_X'}
self._create_multiple_volumes_with_different_project()
test_utils.create_volume(self.ctxt, metadata=metadata)
self.mock_object(ViewBuilder, '_get_volume_type',
v2_fakes.fake_volume_type_name_get)
# Request with 'all_tenants' and 'metadata'
req = fakes.HTTPRequest.blank(
"/v3/volumes/detail?all_tenants=1"
"&metadata=%7B%27key_X%27%3A+%27value_X%27%7D")
ctxt = context.RequestContext(fake.USER_ID, fake.PROJECT_ID, False)
req.environ['cinder.context'] = ctxt
res_dict = self.controller._get_volumes(req, is_detail=True)
self.assertEqual(1, len(res_dict['volumes']))
self.assertEqual(metadata, res_dict['volumes'][0]['metadata'])
def test_volume_index_filter_by_group_id_in_unsupport_version(self): def test_volume_index_filter_by_group_id_in_unsupport_version(self):
self._create_volume_with_group() self._create_volume_with_group()
req = fakes.HTTPRequest.blank(("/v3/volumes?group_id=%s") % req = fakes.HTTPRequest.blank(("/v3/volumes?group_id=%s") %
fake.GROUP_ID) fake.GROUP_ID)
req.headers = mv.get_mv_header(mv.BACKUP_UPDATE) req.headers = mv.get_mv_header(mv.BACKUP_UPDATE)
req.api_version_request = mv.get_api_version(mv.BACKUP_UPDATE) req.api_version_request = mv.get_api_version(mv.BACKUP_UPDATE)
req.environ['cinder.context'] = self.ctxt req.environ['cinder.context'] = self.ctxt
res_dict = self.controller.index(req) res_dict = self.controller.index(req)
volumes = res_dict['volumes'] volumes = res_dict['volumes']
self.assertEqual(2, len(volumes)) self.assertEqual(2, len(volumes))
 End of changes. 1 change blocks. 
0 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)