Skip to content

Commit

Permalink
Fix WP Photo Directory DAG (#5038)
Browse files Browse the repository at this point in the history
Co-authored-by: Krystle Salazar <[email protected]>
  • Loading branch information
sarayourfriend and krysal authored Oct 14, 2024
1 parent 8768751 commit 5685f88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion catalog/dags/providers/provider_api_scripts/wordpress.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def get_next_query_params(self, prev_query_params: dict | None) -> dict:
self.current_page = prev_query_params["page"] + 1

return {
"format": "json",
"page": self.current_page,
"per_page": self.batch_limit,
"_embed": "true",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ def test_get_query_params_returns_defaults_and_sets_total_pages():
with patch.object(wp.delayed_requester, "head", return_value=mock_head_request):
actual_result = wp.get_next_query_params({})

expected_result = {"format": "json", "page": 1, "per_page": 100, "_embed": "true"}
expected_result = {"page": 1, "per_page": 100, "_embed": "true"}
assert actual_result == expected_result
assert wp.total_pages == 5


def test_get_query_params_increments_current_page(ingester):
expected_result = {"format": "json", "page": 3, "per_page": 100, "_embed": "true"}
expected_result = {"page": 3, "per_page": 100, "_embed": "true"}
actual_result = ingester.get_next_query_params({**expected_result, "page": 2})
assert actual_result == expected_result

Expand Down

0 comments on commit 5685f88

Please sign in to comment.