`HeadersMatcher: 're.Pattern' object has no attribute 'decode'` with pook 1.2.0
silverwind opened this issue · 3 comments
silverwind commented
Not sure if actionable, but after upgrading from 1.1.1 to 1.2.0, I see this new error on a test where pook can not match on the request headers any more it seems. No additional details or stack trace unfortunately.
pook error!
=> Cannot match any mock for the following request:
==================================================
Method: POST
URL: https://foo.bar
Headers: HTTPHeaderDict({})
Body: {}}
==================================================
=> Detailed matching errors:
HeadersMatcher: 're.Pattern' object has no attribute 'decode'
The test uses headers
and headers_present
, if that helps:
pook.post(
url,
reply=200,
headers={
"content-type": "application/json"
},
headers_present=[
"foo"
],
response_json={},
)
sarayourfriend commented
This was probably introduced in #90. Off the top of my head we just need to check for the regex patterns Pook itself creates for headers_present
, and which are an allowed part of the API in any case.
Thanks for the bug report.
sarayourfriend commented
@silverwind This is fixed in https://github.com/h2non/pook/releases/tag/v1.2.1
silverwind commented
Thanks, my tests now ran through without modification after upgrading.