Skip to content

Commit

Permalink
Fix bindings wrongly mangling response headers
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellweg committed Jan 2, 2025
1 parent 9873a49 commit 4c27f78
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pulpcore/tests/functional/api/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@
pytestmark = [pytest.mark.parallel]


@pytest.fixture(autouse=True)
def _fix_response_headers(monkeypatch, pulpcore_bindings):
"""
Fix bindings incorrectly translating HTTPHeaderDict to dict.
Ideally they wouldn't even make it a dict, but keep it whatever case insensitive multivalued
mapping the underlying http adapter provides. Alternatively translate everything into the
mutidict.CIMultiDict type.
"""
monkeypatch.setattr(
pulpcore_bindings.module.rest.RESTResponse,
"getheaders",
lambda self: dict(self.response.headers),
)


@pytest.fixture
def session_user(pulpcore_bindings, gen_user, anonymous_user):
old_cookie = pulpcore_bindings.client.cookie
Expand Down

0 comments on commit 4c27f78

Please sign in to comment.