Add custom recipes listing API#222
Open
Dragons0458 wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #222 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 833 849 +16
Branches 53 56 +3
=========================================
+ Hits 833 849 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
7b56436 to
7e2018a
Compare
7e2018a to
88d3b59
Compare
88d3b59 to
d17ea88
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Cookidoo exposes methods to fetch and manage individual custom recipes, but the client does not currently provide a way to retrieve the user's complete custom recipe list.
The custom recipe listing endpoint also returns recipe content in a slightly different shape from the individual recipe endpoint, so the existing parser needs to understand both representations.
Objective
The goal of this PR is to add a focused
list_custom_recipes()API while preserving the behavior of the existing custom recipe methods.What changed
List custom recipes
list_custom_recipes()to retrieve all custom recipes fromcreated-recipes/{language}._request_jsonhelper so authorization failures, request errors, timeouts, malformed responses, and JSON parsing remain consistent with the rest of the client.List response parsing
toolortoolsrecipeYieldoryieldrecipeIngredientoringredientsrecipeInstructionsorinstructionstextinto the existinglist[str]public representation.Any.Tests
Behavioral notes
list_custom_recipes()returnslist[CookidooCustomRecipe].CookidooCustomReciperepresentation remains unchanged.Validation
.venv/bin/python -m pytest -q --cov-config=pyproject.toml --cov=cookidoo_api --cov-branch --cov-report=term-missing --cov-fail-under=100270 passed849/849112/112100.00%.venv/bin/python -m pytest -q smoke_test/test_2_methods.py::TestMethods::test_cookidoo_list_custom_recipes1 passedagainst the real Cookidoo endpoint.venv/bin/python -m ruff check ..venv/bin/python -m mypy cookidoo_api