Skip to content

Commit

Permalink
Update pook to v2 (#4582)
Browse files Browse the repository at this point in the history
* Update API pook to v2 and address breaking changes

* Update catalog pook to v2

* Upgrade indexer worker pook to v2
  • Loading branch information
sarayourfriend authored Jul 16, 2024
1 parent c4b15ae commit b3e5673
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions api/pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test = [
"factory-boy >=3.3.0, <4",
"fakeredis >=2.21.3, <3",
"freezegun >=1.4.0, <2",
"pook >=1.4.3, <2",
"pook >=2, <3",
"pytest >=7.4.4, <8",
"pytest-django >=4.8.0, <5",
"pytest-pook>=1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion api/test/unit/utils/test_watermark.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def mock_request():
pook.get("http://example.com/")
.header("User-Agent", HEADERS["User-Agent"])
.reply(200)
.body(_MOCK_IMAGE_BYTES, binary=True)
.body(_MOCK_IMAGE_BYTES)
.mock
)
yield mock
Expand Down
2 changes: 1 addition & 1 deletion api/test/unit/utils/test_waveform.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def mock_request():
.header("User-Agent", UA_STRING)
.reply(200)
.headers({"Content-Type": _MOCK_AUDIO_INFO["headers"]["Content-Type"]})
.body(_MOCK_AUDIO_BYTES, binary=True)
.body(_MOCK_AUDIO_BYTES)
.mock
)
yield mock
Expand Down
2 changes: 1 addition & 1 deletion api/test/unit/views/test_image_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_oembed_sends_ua_header(api_client):
pook.get(image.url)
.header("User-Agent", ImageViewSet.OEMBED_HEADERS["User-Agent"])
.reply(200)
.body(_MOCK_IMAGE_BYTES, binary=True)
.body(_MOCK_IMAGE_BYTES)
)
res = api_client.get("/v1/images/oembed/", data={"url": image.url})

Expand Down
2 changes: 1 addition & 1 deletion catalog/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

flaky==3.8.1
ipython
pook==1.4.3
pook==2.0.0
pytest-env
pytest-mock
pytest-raises==0.11
Expand Down
8 changes: 4 additions & 4 deletions indexer_worker/pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion indexer_worker/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dev = [
"pytest-order~=1.1",
"pytest-sugar~=0.9",
"remote-pdb~=2.1",
"pook~=1.0",
"pook~=2.0",
]

[build-system]
Expand Down

0 comments on commit b3e5673

Please sign in to comment.