unit tests: AttributeError: 'dict' object has no attribute 'get_all'

Bug #2074131 reported by Thomas Goirand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
New
Undecided
Unassigned

Bug Description

Hi,

As per this Debian bug report:
https://bugs.debian.org/1076910

rebuilding python-glanceclient currently fails in Debian unstable. Here's one of the 3 failures (since they are all similar). Please help me fix.

FAIL: glanceclient.tests.unit.test_shell.ShellTestRequests.test_download_has_no_stray_output_to_stdout
glanceclient.tests.unit.test_shell.ShellTestRequests.test_download_has_no_stray_output_to_stdout
----------------------------------------------------------------------
testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/glanceclient/tests/unit/test_shell.py", line 912, in test_download_has_no_stray_output_to_stdout
    shell.main(argstr.split())
  File "/<<PKGBUILDDIR>>/glanceclient/shell.py", line 588, in main
    args.func(client, args)
  File "/<<PKGBUILDDIR>>/glanceclient/v1/shell.py", line 163, in do_image_download
    body = image.data()
           ^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/glanceclient/v1/images.py", line 55, in data
    return self.manager.data(self, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/glanceclient/v1/images.py", line 146, in data
    resp, body = self.client.get('/v1/images/%s'
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/glanceclient/common/http.py", line 318, in get
    return self._request('GET', url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/glanceclient/common/http.py", line 272, in _request
    resp = self.session.request(method,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests_mock/mocker.py", line 185, in _fake_send
    return _original_send(session, request, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests_mock/adapter.py", line 248, in send
    resp = matcher(request)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests_mock/adapter.py", line 228, in __call__
    return response_matcher.get_response(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests_mock/response.py", line 268, in get_response
    return create_response(request,
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests_mock/response.py", line 205, in create_response
    _extract_cookies(request, response, kwargs.get('cookies'))
  File "/usr/lib/python3/dist-packages/requests_mock/response.py", line 103, in _extract_cookies
    response.cookies.extract_cookies(MockResponse(response.raw.headers),
  File "/usr/lib/python3.12/http/cookiejar.py", line 1685, in extract_cookies
    for cookie in self.make_cookies(response, request):
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/http/cookiejar.py", line 1603, in make_cookies
    rfc2965_hdrs = headers.get_all("Set-Cookie2", [])
                   ^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'get_all'

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.