Merge "Change with_data=False for swift_get_container" into stable/ussuri

This commit is contained in:
Zuul 2021-08-02 13:11:51 +00:00 committed by Gerrit Code Review
commit f276f0226d
2 changed files with 3 additions and 2 deletions

View File

@ -177,7 +177,7 @@ def swift_get_containers(request, marker=None, prefix=None):
@profiler.trace
@safe_swift_exception
def swift_get_container(request, container_name, with_data=True):
def swift_get_container(request, container_name, with_data=False):
if with_data:
headers, data = swift_api(request).get_object(container_name, "")
else:

View File

@ -46,7 +46,8 @@ class SwiftApiTests(test.APIMockTestCase):
swift_api = mock_swiftclient.return_value
swift_api.get_object.return_value = (container, objects)
cont = api.swift.swift_get_container(self.request, container.name)
cont = api.swift.swift_get_container(self.request, container.name,
with_data=True)
self.assertEqual(container.name, cont.name)
self.assertEqual(len(objects), len(cont.data))