-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add region/country support for client and user models (#95)
* feat: Add region/country support for client and user models * chore: improve NPID processing to extract region and country names using pycountry * chore: replace regions properties with methods * test: add integration tests for client and user region retrieval * docs: update README to use get_region() method for client and user region retrieval * test: update test_client__get_region.json to simplify account device data * chore: add newline at end of file in test_client.py and test_user.py * refactor: Change get_region to return Country obj from Pycountries - Change get_region to return Country obj from Pycountries - Update test based on the change above - Update dependencies - Re-run unit tests to generate new cassettes - Fix an issue in test_search__get_game_content_id --------- Co-authored-by: Yoshikage Kira <[email protected]>
- Loading branch information
1 parent
99247e4
commit 78d43b3
Showing
90 changed files
with
4,609 additions
and
3,199 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="81" time="4.000" timestamp="2024-07-14T04:11:00.916633" hostname="fv-az1493-266"><testcase classname="tests.integration_tests.integration_test_psnawp_api.core.test_authenticator" name="test_authenticator__authentication" time="0.113" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.core.test_authenticator" name="test_authenticator__access_token_from_refresh_token" time="0.049" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.core.test_authenticator" name="test_authenticator__incorrect_npsso" time="0.016" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__online_id" time="0.031" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__account_id" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__get_profile_legacy" time="0.024" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__account_devices" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__get_friends" time="0.027" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__friend_requests" time="0.018" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__get_groups" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__available_to_play" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__blocked_list" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__trophy_summary" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__trophy_titles" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__trophy_titles_for_title" time="0.013" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__trophies" time="0.013" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__trophies_with_progress" time="0.019" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__trophy_groups_summary" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__trophy_groups_summary_with_progress" time="0.019" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__title_stats" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_client" name="test_client__repr_and_str" time="0.019" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_game_title" name="test_game_title__np_communication_id" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_game_title" name="test_game_title__wrong_title_id" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_game_title" name="test_game_title__get_title_details" time="0.019" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_game_title" name="test_game_title__trophies" time="0.020" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_game_title" name="test_game_title__trophy_groups_summary" time="0.019" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_game_title" name="test_game_title__trophies_game_not_owned_by_user" time="0.014" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_game_title" name="test_game_title__trophy_groups_summary_game_not_owned_by_user" time="0.013" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_game_title" name="test_game_title__trophies_invalid_np_communication_id" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_game_title" name="test_game_title__trophy_groups_summary_invalid_np_communication_id" time="0.013" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__group_incorrect_args_None" time="0.006" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__group_with_wrong_id" time="0.014" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__group_with_users" time="0.946" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__group_with_id" time="0.021" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__get_group_information" time="0.023" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__repr_and_str" time="0.013" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__change_name_dm" time="0.021" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__dming_blocked_user" time="0.364" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__change_name" time="0.020" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__kick_member" time="0.021" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__kick_member_not_found" time="0.021" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__invite_members" time="0.021" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__invite_members_blocked" time="0.021" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_group" name="test_group__leave_group" time="0.021" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_search" name="test_search__universal_search" time="0.016" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_search" name="test_search__get_game_content_id" time="0.017" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_search" name="test_search__get_addon_content_id" time="0.031" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__user" time="0.013" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__user_account_id" time="0.013" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__user_no_argument" time="0.006" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__user_wrong_acc_id" time="0.013" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__prev_online_id" time="0.013" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__user_not_found" time="0.013" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__user_acct_id_not_found" time="0.013" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__get_profile" time="0.021" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__get_presence" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__get_presence_forbidden" time="0.011" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__friendship" time="0.015" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__accept_friend_request" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__remove_friend" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__get_friends" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__get_friends_forbidden" time="0.011" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__is_blocked" time="0.011" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__trophy_summary" time="0.021" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__trophy_summary_forbidden" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__trophy_titles" time="0.032" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__trophy_titles_forbidden" time="0.011" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__trophy_titles_pagination_test" time="0.291" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__trophy_titles_for_title" time="0.022" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__trophy_titles_for_title_forbidden" time="0.012" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__trophies" time="0.040" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__trophies_with_progress_forbidden" time="0.018" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__trophies_pagination_test" time="0.041" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__trophy_groups_summary" time="0.040" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__trophy_groups_summary_forbidden" time="0.018" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__title_stats" time="0.011" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__title_stats_with_limit" time="0.224" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__title_stats_with_jump" time="0.043" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.models.test_user" name="test_user__repr_and_str" time="0.006" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.utils.test_utils_misc" name="test_play_duration_to_timedelta_valid_inputs" time="0.001" /><testcase classname="tests.integration_tests.integration_test_psnawp_api.utils.test_utils_misc" name="test_play_duration_to_timedelta_invalid_inputs" time="0.001" /></testsuite></testsuites> | ||
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="0" time="0.130" timestamp="2025-01-11T22:28:23.349043-05:00" hostname="pop-os" /></testsuites> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from psnawp_api.utils.endpoints import API_PATH, BASE_PATH | ||
from psnawp_api.utils.misc import iso_format_to_datetime | ||
from psnawp_api.utils.misc import extract_region_from_npid, iso_format_to_datetime | ||
|
||
__all__ = ["BASE_PATH", "API_PATH", "iso_format_to_datetime"] | ||
__all__ = ["BASE_PATH", "API_PATH", "iso_format_to_datetime", "extract_region_from_npid"] |
Oops, something went wrong.