Conversation
Creates scrape_api_docs.py which fetches all 224 API method docs from flickr.com/services/api/ and saves them as JSON files in api-docs/. This enables creating test cases from official API documentation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add tests for Tag.getHotList, Tag.getListUser, and Tag.getListUserPopular using example responses from the api-docs directory. Includes XML-to-JSON converter to transform scraped examples into the format returned by the API. Bug fixes in objects.py: - Tag.getListUser: Use Tag(text=t) instead of Tag(**t) to match Person.getTags behavior. After clean_content(), tags with only text content become strings, not dicts. - Tag class: Add count converter (dict_converter(["count"], int)) which was missing but present in Place.Tag, needed for getListUserPopular. Include the 3 api-docs files needed for tests (modify .gitignore to allow). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
Add tests for
Tag.getHotList,Tag.getListUser, andTag.getListUserPopularusing example responses from the API documentation.Depends on #145
Changes
Tests (
test/test_tags.py)xml_to_flickr_json()utility to convert XML examples to Flickr's JSON formatBug Fixes (
flickr_api/objects.py)Tag(**t)toTag(text=t)to handle string responses correctly (matchingPerson.getTagsbehavior)countconverter forgetListUserPopularOther
.gitignoreto allow)Test plan
uv run --python 3.11 python3 -m unittest discover test/ -v- all 13 tests pass🤖 Generated with Claude Code