-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added last_updated_at in players search results and player summary #184
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ | |
"season": 8 | ||
}, | ||
"console": null | ||
} | ||
}, | ||
"last_updated_at": null | ||
}, | ||
"stats": { | ||
"pc": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ | |
"open": null | ||
}, | ||
"console": null | ||
} | ||
}, | ||
"last_updated_at": null | ||
}, | ||
"stats": { | ||
"pc": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,8 @@ | |
"open": null, | ||
"season": 1 | ||
} | ||
} | ||
}, | ||
"last_updated_at": null | ||
}, | ||
"stats": { | ||
"pc": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,8 @@ | |
"support": null, | ||
"open": null | ||
} | ||
} | ||
}, | ||
"last_updated_at": null | ||
}, | ||
"stats": { | ||
"pc": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ | |
"open": null | ||
}, | ||
"console": null | ||
} | ||
}, | ||
"last_updated_at": 1678536999 | ||
}, | ||
"stats": { | ||
"pc": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,8 @@ | |
"open": null | ||
}, | ||
"console": null | ||
} | ||
}, | ||
"last_updated_at": null | ||
}, | ||
"stats": { | ||
"pc": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,8 @@ | |
"open": null | ||
}, | ||
"console": null | ||
} | ||
}, | ||
"last_updated_at": null | ||
}, | ||
"stats": { | ||
"pc": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,11 @@ async def test_player_page_parsing_with_filters( | |
player_json_data: dict, | ||
kwargs_filter: dict, | ||
): | ||
# Remove "namecard" key from player_json_data, it's been added from another page | ||
# Remove "namecard" and "last_updated_at" keys from player_json_data, | ||
# it's been added from others parsers | ||
player_data = player_json_data.copy() | ||
del player_data["summary"]["namecard"] | ||
del player_data["summary"]["last_updated_at"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (testing): Add test for LastUpdatedAtParser While the test has been updated to remove the last_updated_at field from the player data, it would be beneficial to add a separate test case for the LastUpdatedAtParser to ensure it correctly parses and returns the last_updated_at value.
|
||
|
||
parser = PlayerParser(player_id=player_id) | ||
update_parser_cache_last_update_mock = Mock() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Add error handling for missing 'lastUpdated' key
Consider adding error handling in case the 'lastUpdated' key is missing from the player_data dictionary. You could use a try-except block or the dict.get() method with a default value to make this more robust and prevent potential KeyError exceptions.