pychpp 0.6.0__tar.gz → 0.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pychpp-0.6.1/.flake8 +7 -0
- pychpp-0.6.1/.gitignore +7 -0
- pychpp-0.6.1/.gitlab-ci.yml +29 -0
- pychpp-0.6.1/.python-version +1 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/PKG-INFO +18 -19
- {pychpp-0.6.0 → pychpp-0.6.1}/README.md +9 -0
- pychpp-0.6.1/pyproject.toml +32 -0
- pychpp-0.6.1/tests/__init__.py +0 -0
- pychpp-0.6.1/tests/conftest.py +59 -0
- pychpp-0.6.1/tests/test_chpp_access.py +17 -0
- pychpp-0.6.1/tests/test_custom_ht_arena.py +37 -0
- pychpp-0.6.1/tests/test_custom_ht_challenge.py +22 -0
- pychpp-0.6.1/tests/test_custom_ht_league.py +24 -0
- pychpp-0.6.1/tests/test_custom_ht_league_unit.py +27 -0
- pychpp-0.6.1/tests/test_custom_ht_match.py +33 -0
- pychpp-0.6.1/tests/test_custom_ht_match_lineup.py +146 -0
- pychpp-0.6.1/tests/test_custom_ht_matches_archive.py +35 -0
- pychpp-0.6.1/tests/test_custom_ht_region.py +36 -0
- pychpp-0.6.1/tests/test_custom_ht_team.py +48 -0
- pychpp-0.6.1/tests/test_custom_ht_user.py +17 -0
- pychpp-0.6.1/tests/test_custom_ht_youth_team.py +25 -0
- pychpp-0.6.1/tests/test_ht_datetime.py +32 -0
- pychpp-0.6.1/tests/test_resources/file=achievements&version=1.2&userID=1728698.xml +516 -0
- pychpp-0.6.1/tests/test_resources/file=achievements&version=1.3&userID=1728698.xml +859 -0
- pychpp-0.6.1/tests/test_resources/file=achievements&version=1.4&userID=1728698.xml +905 -0
- pychpp-0.6.1/tests/test_resources/file=alliancedetails&version=1.5&actionType=view&allianceID=118840.xml +42 -0
- pychpp-0.6.1/tests/test_resources/file=alliances&version=1.4&searchFor=flag&searchType=1.xml +217 -0
- pychpp-0.6.1/tests/test_resources/file=alliances&version=1.5&searchFor=&searchType=5&userId=1728698.xml +10 -0
- pychpp-0.6.1/tests/test_resources/file=alliances&version=1.5&searchFor=&searchType=5.xml +10 -0
- pychpp-0.6.1/tests/test_resources/file=alliances&version=1.5&searchFor=flag&searchType=1.xml +217 -0
- pychpp-0.6.1/tests/test_resources/file=arenadetails&version=1.7&arenaID=1420520.xml +33 -0
- pychpp-0.6.1/tests/test_resources/file=arenadetails&version=1.7&arenaID=1751912.xml +33 -0
- pychpp-0.6.1/tests/test_resources/file=arenadetails&version=1.7&arenaID=295023.xml +33 -0
- pychpp-0.6.1/tests/test_resources/file=avatars&version=1.1&actionType=players&teamId=960935.xml +677 -0
- pychpp-0.6.1/tests/test_resources/file=bookmarks&version=1.0.xml +498 -0
- pychpp-0.6.1/tests/test_resources/file=club&version=1.5.xml +24 -0
- pychpp-0.6.1/tests/test_resources/file=cupmatches&version=1.4&CupID=183&CupRound=6&Season=88.xml +190 -0
- pychpp-0.6.1/tests/test_resources/file=currentbids&version=1.0&actionType=view.xml +20 -0
- pychpp-0.6.1/tests/test_resources/file=economy&version=1.4.xml +50 -0
- pychpp-0.6.1/tests/test_resources/file=fans&version=1.3.xml +174 -0
- pychpp-0.6.1/tests/test_resources/file=hofplayers&version=1.2&teamID=1750803.xml +99 -0
- pychpp-0.6.1/tests/test_resources/file=hofplayers&version=1.3&teamID=1750803.xml +188 -0
- pychpp-0.6.1/tests/test_resources/file=ladderdetails&version=1.0&ladderid=1257867&pageindex=0.xml +61 -0
- pychpp-0.6.1/tests/test_resources/file=ladderlist&version=1.0&teamId=964324.xml +40 -0
- pychpp-0.6.1/tests/test_resources/file=leaguefixtures&version=1.2&leagueLevelUnitID=36378&season=76.xml +849 -0
- pychpp-0.6.1/tests/test_resources/file=leaguefixtures&version=1.2.xml +761 -0
- pychpp-0.6.1/tests/test_resources/file=leaguelevels&version=1.0&LeagueID=5.xml +77 -0
- pychpp-0.6.1/tests/test_resources/file=live&version=2.3&actionType=view&includeStartingLineup=True&sourceSystem=hattrick&useLiveEventsAndTexts=True.xml +351 -0
- pychpp-0.6.1/tests/test_resources/file=live&version=2.4&actionType=view&includeStartingLineup=True&matchID=773342689&sourceSystem=hattrick&useLiveEventsAndTexts=True.xml +391 -0
- pychpp-0.6.1/tests/test_resources/file=managercompendium&version=1.5&userID=9638716.xml +83 -0
- pychpp-0.6.1/tests/test_resources/file=managercompendium&version=1.8&userID=9638716.xml +86 -0
- pychpp-0.6.1/tests/test_resources/file=managercompendium&version=1.8.xml +95 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=36370661&sourceSystem=htointegrated.xml +29 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=547513790.xml +389 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=685566813.xml +566 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=685860616.xml +664 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=690094305.xml +577 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=690183773.xml +743 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=690328642.xml +624 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=693127128.xml +756 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=695301077.xml +564 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.1&matchID=660688698&sourceSystem=Hattrick.xml +171 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.1&matchID=744337584.xml +55 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=547513790.xml +391 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=685566813.xml +568 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=685860616.xml +664 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=690094305.xml +577 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=690183773.xml +743 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=690328642.xml +624 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=693127128.xml +756 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=695301077.xml +564 -0
- pychpp-0.6.1/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=775863574.xml +497 -0
- pychpp-0.6.1/tests/test_resources/file=matches&version=2.9.xml +283 -0
- pychpp-0.6.1/tests/test_resources/file=matches&version=3.0.xml +240 -0
- pychpp-0.6.1/tests/test_resources/file=matchlineup&version=2.1&matchID=136016609&sourceSystem=Youth&teamID=499165.xml +267 -0
- pychpp-0.6.1/tests/test_resources/file=matchlineup&version=2.1&matchID=660688698&teamID=86324.xml +349 -0
- pychpp-0.6.1/tests/test_resources/file=matchlineup&version=2.1&matchID=685566813&teamID=1750803.xml +360 -0
- pychpp-0.6.1/tests/test_resources/file=matchlineup&version=2.1&matchID=685860616&teamID=113143.xml +368 -0
- pychpp-0.6.1/tests/test_resources/file=matchlineup&version=2.1&matchID=690094305&teamID=296272.xml +321 -0
- pychpp-0.6.1/tests/test_resources/file=matchlineup&version=2.1&matchID=690183773&teamID=2053693.xml +261 -0
- pychpp-0.6.1/tests/test_resources/file=matchlineup&version=2.1&matchID=690328642&teamID=773670.xml +318 -0
- pychpp-0.6.1/tests/test_resources/file=matchlineup&version=2.1&matchID=693127128&teamID=291394.xml +367 -0
- pychpp-0.6.1/tests/test_resources/file=matchlineup&version=2.1&matchID=695301077&teamID=294798.xml +332 -0
- pychpp-0.6.1/tests/test_resources/file=matchlineup&version=2.2&matchID=773342689&teamID=649632.xml +391 -0
- pychpp-0.6.1/tests/test_resources/file=matchorders&version=3.1&actionType=view&matchID=739349000&sourceSystem=Hattrick.xml +278 -0
- pychpp-0.6.1/tests/test_resources/file=nationalplayers&version=1.5&actionType=view&teamID=3004.xml +885 -0
- pychpp-0.6.1/tests/test_resources/file=nationalprospectplayers&version=1.0&teamID=3001.xml +7064 -0
- pychpp-0.6.1/tests/test_resources/file=nationalteamdetails&version=1.9&teamID=3014.xml +41 -0
- pychpp-0.6.1/tests/test_resources/file=nationalteamdetails&version=2.0&teamID=3014.xml +67 -0
- pychpp-0.6.1/tests/test_resources/file=nationalteammatches&version=1.4.xml +2858 -0
- pychpp-0.6.1/tests/test_resources/file=nationalteams&version=1.6&LeagueOfficeTypeID=2.xml +2876 -0
- pychpp-0.6.1/tests/test_resources/file=playerdetails&version=3.0&playerID=432002549.xml +66 -0
- pychpp-0.6.1/tests/test_resources/file=playerdetails&version=3.0&playerID=453276953.xml +63 -0
- pychpp-0.6.1/tests/test_resources/file=playerdetails&version=3.0&playerID=473582922.xml +75 -0
- pychpp-0.6.1/tests/test_resources/file=playerdetails&version=3.3&playerID=430759322.xml +79 -0
- pychpp-0.6.1/tests/test_resources/file=playerdetails&version=3.3&playerID=432002549.xml +182 -0
- pychpp-0.6.1/tests/test_resources/file=playerdetails&version=3.3&playerID=453276953.xml +68 -0
- pychpp-0.6.1/tests/test_resources/file=playerevents&version=1.3&playerID=445879103.xml +97 -0
- pychpp-0.6.1/tests/test_resources/file=players&version=2.8&actionType=view&teamID=1165592.xml +1370 -0
- pychpp-0.6.1/tests/test_resources/file=players&version=2.8&actionType=viewOldies&teamID=1165592.xml +62 -0
- pychpp-0.6.1/tests/test_resources/file=playerstats&version=1.0&playerID=430759322.xml +1030 -0
- pychpp-0.6.1/tests/test_resources/file=regiondetails&version=1.2®ionID=149.xml +18 -0
- pychpp-0.6.1/tests/test_resources/file=search&version=1.2&searchLeagueID=-1&searchString=Bob&searchString2=Sunesson&searchType=0.xml +37 -0
- pychpp-0.6.1/tests/test_resources/file=staffavatars&version=1.1.xml +146 -0
- pychpp-0.6.1/tests/test_resources/file=stafflist&version=1.2.xml +61 -0
- pychpp-0.6.1/tests/test_resources/file=stafflist&version=1.3.xml +65 -0
- pychpp-0.6.1/tests/test_resources/file=supporters&version=1.0&actionType=supportedteams&userId=13481763.xml +773 -0
- pychpp-0.6.1/tests/test_resources/file=supporters&version=1.1&actionType=mysupporters&teamId=1165592.xml +60 -0
- pychpp-0.6.1/tests/test_resources/file=supporters&version=1.1&actionType=supportedteams&userId=13481763.xml +823 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=3.6&teamID=1755350.xml +625 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=3.6&teamID=295023.xml +344 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=3.6&teamID=326336.xml +285 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=3.6&teamID=987765.xml +670 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=3.7&teamID=1755350.xml +557 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=3.7&teamID=2513478.xml +91 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=3.7&teamID=295023.xml +251 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=3.8&teamID=1755350.xml +84 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=3.9&teamID=1755350.xml +85 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=4.0&teamID=1755350.xml +85 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=4.0&teamID=2513478.xml +86 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=4.0&teamID=295023.xml +253 -0
- pychpp-0.6.1/tests/test_resources/file=teamdetails&version=4.0.xml +137 -0
- pychpp-0.6.1/tests/test_resources/file=teamhistory&version=1.0&teamId=1165592.xml +415 -0
- pychpp-0.6.1/tests/test_resources/file=tournamentdetails&version=1.0&season=23&tournamentId=3116071.xml +24 -0
- pychpp-0.6.1/tests/test_resources/file=tournamentfixtures&version=1.0&tournamentId=3116071.xml +1142 -0
- pychpp-0.6.1/tests/test_resources/file=tournamentfixtures&version=1.1&matchRound=9&tournamentId=3116071.xml +584 -0
- pychpp-0.6.1/tests/test_resources/file=tournamentleaguetables&version=1.1&tournamentId=5292015.xml +176 -0
- pychpp-0.6.1/tests/test_resources/file=tournamentlist&version=1.0&teamId=1758305.xml +26 -0
- pychpp-0.6.1/tests/test_resources/file=training&version=2.2&actionType=view&teamId=1165592.xml +37 -0
- pychpp-0.6.1/tests/test_resources/file=training&version=2.3&actionType=view&teamId=1165592.xml +36 -0
- pychpp-0.6.1/tests/test_resources/file=trainingevents&version=1.3&playerID=456732884.xml +48 -0
- pychpp-0.6.1/tests/test_resources/file=transfersearch&version=1.1&ageMax=22&ageMin=20&maxSkillValue1=9&minSkillValue1=7&skillType1=8.xml +937 -0
- pychpp-0.6.1/tests/test_resources/file=transfersearch&version=1.2&ageMax=22&ageMin=20&maxSkillValue1=9&minSkillValue1=7&salaryMax=10000&skillType1=8.xml +923 -0
- pychpp-0.6.1/tests/test_resources/file=transfersplayer&version=1.1&playerID=427947863.xml +43 -0
- pychpp-0.6.1/tests/test_resources/file=transfersteam&version=1.2&pageIndex=1&teamID=940.xml +498 -0
- pychpp-0.6.1/tests/test_resources/file=translations&version=1.2&languageId=5.xml +993 -0
- pychpp-0.6.1/tests/test_resources/file=worldcup&version=1.1&actionType=viewGroups&season=76.xml +125 -0
- pychpp-0.6.1/tests/test_resources/file=worldcup&version=1.1&actionType=viewMatches&cupSeriesUnitID=1697&season=76.xml +128 -0
- pychpp-0.6.1/tests/test_resources/file=worlddetails&version=1.9&includeRegions=True&leagueID=25.xml +239 -0
- pychpp-0.6.1/tests/test_resources/file=worlddetails&version=1.9.xml +14527 -0
- pychpp-0.6.1/tests/test_resources/file=worlddetails&version=2.1&leagueID=25.xml +141 -0
- pychpp-0.6.1/tests/test_resources/file=worldlanguages&version=1.2.xml +228 -0
- pychpp-0.6.1/tests/test_resources/file=youthavatars&version=1.2.xml +497 -0
- pychpp-0.6.1/tests/test_resources/file=youthleaguedetails&version=1.0.xml +66 -0
- pychpp-0.6.1/tests/test_resources/file=youthleaguedetails&version=1.1.xml +67 -0
- pychpp-0.6.1/tests/test_resources/file=youthleaguefixtures&version=1.0&youthleagueid=251460.xml +2030 -0
- pychpp-0.6.1/tests/test_resources/file=youthplayerdetails&version=1.2&actionType=details&showLastMatch=False&showScoutCall=False&youthPlayerID=301741211.xml +52 -0
- pychpp-0.6.1/tests/test_resources/file=youthplayerdetails&version=1.2&actionType=details&showLastMatch=False&showScoutCall=False&youthPlayerID=384579961.xml +36 -0
- pychpp-0.6.1/tests/test_resources/file=youthplayerdetails&version=1.2&actionType=details&showLastMatch=False&showScoutCall=False&youthPlayerID=395385356.xml +36 -0
- pychpp-0.6.1/tests/test_resources/file=youthplayerdetails&version=1.2&actionType=details&showLastMatch=False&showScoutCall=False&youthPlayerID=395583001.xml +36 -0
- pychpp-0.6.1/tests/test_resources/file=youthplayerdetails&version=1.4&actionType=details&showLastMatch=False&showScoutCall=False&youthPlayerID=301741224.xml +54 -0
- pychpp-0.6.1/tests/test_resources/file=youthplayerdetails&version=1.4&actionType=details&showLastMatch=False&showScoutCall=False&youthPlayerID=449911155.xml +38 -0
- pychpp-0.6.1/tests/test_resources/file=youthplayerlist&version=1.4&actionType=details.xml +680 -0
- pychpp-0.6.1/tests/test_resources/file=youthplayerlist&version=1.4&actionType=list.xml +106 -0
- pychpp-0.6.1/tests/test_resources/file=youthteamdetails&version=1.2&youthTeamID=2745926.xml +38 -0
- pychpp-0.6.1/tests/test_resources/file=youthteamdetails&version=1.2&youthTeamID=3147468.xml +34 -0
- pychpp-0.6.1/tests/test_resources/file=youthteamdetails&version=1.5&youthTeamID=2942691.xml +41 -0
- pychpp-0.6.1/tests/test_xml_achievements.py +87 -0
- pychpp-0.6.1/tests/test_xml_alliance_details.py +41 -0
- pychpp-0.6.1/tests/test_xml_alliances.py +50 -0
- pychpp-0.6.1/tests/test_xml_avatars.py +20 -0
- pychpp-0.6.1/tests/test_xml_bookmarks.py +15 -0
- pychpp-0.6.1/tests/test_xml_club.py +20 -0
- pychpp-0.6.1/tests/test_xml_cup_matches.py +28 -0
- pychpp-0.6.1/tests/test_xml_current_bids.py +28 -0
- pychpp-0.6.1/tests/test_xml_economy.py +50 -0
- pychpp-0.6.1/tests/test_xml_fans.py +45 -0
- pychpp-0.6.1/tests/test_xml_hof_players.py +57 -0
- pychpp-0.6.1/tests/test_xml_ladder_details.py +27 -0
- pychpp-0.6.1/tests/test_xml_ladder_list.py +17 -0
- pychpp-0.6.1/tests/test_xml_league_fixtures.py +21 -0
- pychpp-0.6.1/tests/test_xml_league_levels.py +21 -0
- pychpp-0.6.1/tests/test_xml_live.py +132 -0
- pychpp-0.6.1/tests/test_xml_manager_compendium.py +53 -0
- pychpp-0.6.1/tests/test_xml_match_details.py +101 -0
- pychpp-0.6.1/tests/test_xml_match_lineup.py +65 -0
- pychpp-0.6.1/tests/test_xml_match_orders.py +40 -0
- pychpp-0.6.1/tests/test_xml_matches.py +87 -0
- pychpp-0.6.1/tests/test_xml_matches_archive.py +37 -0
- pychpp-0.6.1/tests/test_xml_national_players.py +18 -0
- pychpp-0.6.1/tests/test_xml_national_prospect_players.py +23 -0
- pychpp-0.6.1/tests/test_xml_national_team_details.py +38 -0
- pychpp-0.6.1/tests/test_xml_national_team_matches.py +22 -0
- pychpp-0.6.1/tests/test_xml_national_teams.py +15 -0
- pychpp-0.6.1/tests/test_xml_player_events.py +18 -0
- pychpp-0.6.1/tests/test_xml_player_stats.py +52 -0
- pychpp-0.6.1/tests/test_xml_players.py +37 -0
- pychpp-0.6.1/tests/test_xml_players_details.py +83 -0
- pychpp-0.6.1/tests/test_xml_search.py +20 -0
- pychpp-0.6.1/tests/test_xml_staff_avatars.py +16 -0
- pychpp-0.6.1/tests/test_xml_staff_list.py +51 -0
- pychpp-0.6.1/tests/test_xml_supporters.py +84 -0
- pychpp-0.6.1/tests/test_xml_team_details.py +222 -0
- pychpp-0.6.1/tests/test_xml_team_history.py +51 -0
- pychpp-0.6.1/tests/test_xml_tournament_details.py +21 -0
- pychpp-0.6.1/tests/test_xml_tournament_fixtures.py +46 -0
- pychpp-0.6.1/tests/test_xml_tournament_league_tables.py +21 -0
- pychpp-0.6.1/tests/test_xml_tournament_list.py +23 -0
- pychpp-0.6.1/tests/test_xml_training.py +75 -0
- pychpp-0.6.1/tests/test_xml_training_events.py +18 -0
- pychpp-0.6.1/tests/test_xml_transfer_search.py +85 -0
- pychpp-0.6.1/tests/test_xml_transfers_player.py +20 -0
- pychpp-0.6.1/tests/test_xml_transfers_team.py +45 -0
- pychpp-0.6.1/tests/test_xml_translations.py +48 -0
- pychpp-0.6.1/tests/test_xml_world_cup.py +38 -0
- pychpp-0.6.1/tests/test_xml_world_details.py +34 -0
- pychpp-0.6.1/tests/test_xml_world_languages.py +6 -0
- pychpp-0.6.1/tests/test_xml_youth_avatars.py +12 -0
- pychpp-0.6.1/tests/test_xml_youth_league_details.py +39 -0
- pychpp-0.6.1/tests/test_xml_youth_league_fixtures.py +28 -0
- pychpp-0.6.1/tests/test_xml_youth_player_details.py +133 -0
- pychpp-0.6.1/tests/test_xml_youth_player_list.py +25 -0
- pychpp-0.6.1/tests/test_xml_youth_team_details.py +25 -0
- pychpp-0.6.1/uv.lock +518 -0
- pychpp-0.6.0/pyproject.toml +0 -24
- {pychpp-0.6.0 → pychpp-0.6.1}/LICENSE +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/__init__.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/chpp.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/fixtures/__init__.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/fixtures/ht_datetime.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/fixtures/ht_error.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/__init__.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/__init__.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/base/__init__.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/base/ht_arena.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/base/ht_country.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/base/ht_league.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/base/ht_league_unit.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/base/ht_match.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/base/ht_player.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/base/ht_region.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/base/ht_team.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/base/ht_user.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_arena.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_challenge.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_league.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_league_unit.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_match.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_match_lineup.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_matches_archive.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_player.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_region.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_team.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_transfer_history.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_user.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_youth_player.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/custom/ht_youth_team.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/ht_field.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/ht_init_var.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/ht_model.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/ht_version.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/ht_xml.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/__init__.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/achievements.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/alliance_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/alliances.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/arena_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/avatars.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/bookmarks.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/challenges.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/club.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/cup_matches.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/current_bids.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/economy.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/fans.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/hof_players.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/ladder_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/ladder_list.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/league_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/league_fixtures.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/league_levels.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/live.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/manager_compendium.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/match_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/match_lineup.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/match_orders.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/matches.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/matches_archive.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/national_players.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/national_prospect_players.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/national_team_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/national_team_matches.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/national_teams.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/player_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/player_events.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/player_stats.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/players.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/region_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/search.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/staff_avatars.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/staff_list.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/supporters.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/team_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/team_history.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/tournament_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/tournament_fixtures.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/tournament_league_tables.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/tournament_list.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/training.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/training_events.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/transfer_search.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/transfers_player.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/transfers_team.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/translations.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/world_cup.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/world_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/world_languages.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/youth_avatars.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/youth_league_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/youth_league_fixtures.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/youth_player_details.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/youth_player_list.py +0 -0
- {pychpp-0.6.0 → pychpp-0.6.1}/pychpp/models/xml/youth_team_details.py +0 -0
pychpp-0.6.1/.flake8
ADDED
pychpp-0.6.1/.gitignore
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
image: "python:3.11"
|
|
2
|
+
|
|
3
|
+
before_script:
|
|
4
|
+
- echo PYCHPP_CONSUMER_KEY=$PYCHPP_CONSUMER_KEY >> .env
|
|
5
|
+
- echo PYCHPP_CONSUMER_SECRET=$PYCHPP_CONSUMER_SECRET >> .env
|
|
6
|
+
- echo PYCHPP_ACCESS_TOKEN_KEY=$PYCHPP_ACCESS_TOKEN_KEY >> .env
|
|
7
|
+
- echo PYCHPP_ACCESS_TOKEN_SECRET=$PYCHPP_ACCESS_TOKEN_SECRET >> .env
|
|
8
|
+
- echo PYCHPP_SCOPE=$PYCHPP_SCOPE >> .env
|
|
9
|
+
- pip install uv
|
|
10
|
+
- uv sync --frozen
|
|
11
|
+
|
|
12
|
+
stages:
|
|
13
|
+
- test
|
|
14
|
+
- deploy
|
|
15
|
+
|
|
16
|
+
style:
|
|
17
|
+
stage: test
|
|
18
|
+
script: uv run flake8
|
|
19
|
+
|
|
20
|
+
test:
|
|
21
|
+
stage: test
|
|
22
|
+
script: uv run pytest
|
|
23
|
+
|
|
24
|
+
deploy:
|
|
25
|
+
stage: deploy
|
|
26
|
+
only: [master]
|
|
27
|
+
script:
|
|
28
|
+
- uv build
|
|
29
|
+
- uv publish --token $PYCHPP_PYPI_TOKEN
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: pychpp
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.1
|
|
4
4
|
Summary: framework created to use the API provided by the online game Hattrick
|
|
5
|
-
License: Apache-2.0
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Author: Pierre Gobin
|
|
8
|
-
Author-email: p.dev@gobin.cc
|
|
9
|
-
Requires-Python: >=3.9,<4.0
|
|
10
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
-
Requires-Dist: Werkzeug (>=3.1.3,<4.0.0)
|
|
19
|
-
Requires-Dist: pytz (>=2025.1,<2026.0)
|
|
20
|
-
Requires-Dist: requests-oauthlib (>=2.0.0,<3.0.0)
|
|
21
5
|
Project-URL: Homepage, https://framagit.org/Pierre86/pychpp
|
|
6
|
+
Author-email: Pierre Gobin <p.dev@gobin.cc>
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Requires-Dist: pytz>=2025.1
|
|
11
|
+
Requires-Dist: requests-oauthlib>=2.0.0
|
|
12
|
+
Requires-Dist: werkzeug>=3.1.3
|
|
22
13
|
Description-Content-Type: text/markdown
|
|
23
14
|
|
|
24
15
|
# pyCHPP
|
|
@@ -233,6 +224,14 @@ The following table shows the CHPP XML files that are currently supported:
|
|
|
233
224
|
| YouthPlayerList | `youthplayerlist.xml` |
|
|
234
225
|
| YouthTeamDetails | `youthteamdetails.xml` |
|
|
235
226
|
|
|
227
|
+
## Development
|
|
228
|
+
|
|
229
|
+
This project uses [uv](https://docs.astral.sh/uv/) to manage dependencies and the virtual environment:
|
|
230
|
+
|
|
231
|
+
uv sync # create .venv and install dependencies (Python version from .python-version)
|
|
232
|
+
uv run pytest tests/
|
|
233
|
+
uv run flake8
|
|
234
|
+
uv lock --upgrade && uv sync # update all dependencies to their latest compatible versions
|
|
235
|
+
|
|
236
236
|
## License
|
|
237
237
|
pyCHPP is licensed under the Apache License 2.0.
|
|
238
|
-
|
|
@@ -210,5 +210,14 @@ The following table shows the CHPP XML files that are currently supported:
|
|
|
210
210
|
| YouthPlayerList | `youthplayerlist.xml` |
|
|
211
211
|
| YouthTeamDetails | `youthteamdetails.xml` |
|
|
212
212
|
|
|
213
|
+
## Development
|
|
214
|
+
|
|
215
|
+
This project uses [uv](https://docs.astral.sh/uv/) to manage dependencies and the virtual environment:
|
|
216
|
+
|
|
217
|
+
uv sync # create .venv and install dependencies (Python version from .python-version)
|
|
218
|
+
uv run pytest tests/
|
|
219
|
+
uv run flake8
|
|
220
|
+
uv lock --upgrade && uv sync # update all dependencies to their latest compatible versions
|
|
221
|
+
|
|
213
222
|
## License
|
|
214
223
|
pyCHPP is licensed under the Apache License 2.0.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "pychpp"
|
|
3
|
+
version = "0.6.1"
|
|
4
|
+
description = "framework created to use the API provided by the online game Hattrick"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "Apache-2.0"
|
|
7
|
+
authors = [
|
|
8
|
+
{ name = "Pierre Gobin", email = "p.dev@gobin.cc" },
|
|
9
|
+
]
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"pytz>=2025.1",
|
|
13
|
+
"werkzeug>=3.1.3",
|
|
14
|
+
"requests-oauthlib>=2.0.0",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[project.urls]
|
|
18
|
+
Homepage = "https://framagit.org/Pierre86/pychpp"
|
|
19
|
+
|
|
20
|
+
[dependency-groups]
|
|
21
|
+
dev = [
|
|
22
|
+
"pytest>=8.3.3",
|
|
23
|
+
"pytest-dotenv>=0.5.2",
|
|
24
|
+
"flake8>=7.1.2",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[build-system]
|
|
28
|
+
requires = ["hatchling"]
|
|
29
|
+
build-backend = "hatchling.build"
|
|
30
|
+
|
|
31
|
+
[tool.hatch.build.targets.wheel]
|
|
32
|
+
packages = ["pychpp"]
|
|
File without changes
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import pathlib
|
|
3
|
+
import xml.etree.ElementTree as EltTree
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
|
|
7
|
+
from pychpp import CHPP
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
PYCHPP_CONSUMER_KEY = os.environ["PYCHPP_CONSUMER_KEY"]
|
|
11
|
+
PYCHPP_CONSUMER_SECRET = os.environ["PYCHPP_CONSUMER_SECRET"]
|
|
12
|
+
PYCHPP_ACCESS_TOKEN_KEY = os.environ["PYCHPP_ACCESS_TOKEN_KEY"]
|
|
13
|
+
PYCHPP_ACCESS_TOKEN_SECRET = os.environ["PYCHPP_ACCESS_TOKEN_SECRET"]
|
|
14
|
+
PYCHPP_SCOPE = os.environ["PYCHPP_SCOPE"]
|
|
15
|
+
|
|
16
|
+
BASE_PATTERN = r"https://www.hattrick.org/goto.ashx\?path="
|
|
17
|
+
TEAM_PATTERN = BASE_PATTERN + r"/Club/\?teamID=(\d+)"
|
|
18
|
+
YOUTH_PLAYER_PATTERN = BASE_PATTERN + r"/Club/Players/YouthPlayer.aspx\?.*youthPlayerID=(\d+).*"
|
|
19
|
+
PLAYER_PATTERN = BASE_PATTERN + r"/Club/Players/Player.aspx\?playerID=(\d+)"
|
|
20
|
+
YOUTH_TEAM_PATTERN = BASE_PATTERN + r"/Club/Youth/\?youthTeamID=(\d+)"
|
|
21
|
+
ARENA_PATTERN = BASE_PATTERN + r"/Club/Stadium/\?arenaID=(\d+)"
|
|
22
|
+
USER_PATTERN = BASE_PATTERN + r"/Club/Manager/\?userID=(\d+)"
|
|
23
|
+
REGION_PATTERN = BASE_PATTERN + r"/World/Regions/Region.aspx\?regionID=(\d+)"
|
|
24
|
+
MATCH_ARCHIVE_PATTERN = BASE_PATTERN + r"/Club/Matches/Archive.aspx\?teamID=(\d+)(&season=(\d+))*"
|
|
25
|
+
MATCH_PATTERN = BASE_PATTERN + r"/Club/Matches/Match.aspx\?matchID=(\d+)"
|
|
26
|
+
MATCH_LINEUP_PATTERN = BASE_PATTERN + r"/Club/Matches/Match.aspx\?matchID=(\d+)&teamID=(\d+)"
|
|
27
|
+
LEAGUE_LEVEL_UNIT_PATTERN = BASE_PATTERN + r"/World/Series/\?leagueLevelUnitID=(\d+)"
|
|
28
|
+
COUNTRY_LEAGUE_PATTERN = BASE_PATTERN + r"/World/Leagues/League.aspx\?.*leagueID=(\d+).*"
|
|
29
|
+
CUP_PATTERN = BASE_PATTERN + r"/World/Cup/Cup.aspx\?cupID=(\d+)"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@pytest.fixture
|
|
33
|
+
def chpp():
|
|
34
|
+
return CHPP(consumer_key=PYCHPP_CONSUMER_KEY,
|
|
35
|
+
consumer_secret=PYCHPP_CONSUMER_SECRET,
|
|
36
|
+
access_token_key=PYCHPP_ACCESS_TOKEN_KEY,
|
|
37
|
+
access_token_secret=PYCHPP_ACCESS_TOKEN_SECRET,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@pytest.fixture
|
|
42
|
+
def mocked_chpp(monkeypatch):
|
|
43
|
+
|
|
44
|
+
def mock_request(*args, **kwargs):
|
|
45
|
+
args_dict = {'file': kwargs.pop('file'), 'version': kwargs.pop('version')}
|
|
46
|
+
kwargs.pop('method')
|
|
47
|
+
args_dict.update(sorted(kwargs.items()))
|
|
48
|
+
filename = '&'.join(f"{k}={v}" for k, v in args_dict.items()) + '.xml'
|
|
49
|
+
|
|
50
|
+
path = pathlib.Path(__file__).parent / "test_resources" / filename
|
|
51
|
+
|
|
52
|
+
with open(path) as f:
|
|
53
|
+
txt = f.read()
|
|
54
|
+
|
|
55
|
+
return EltTree.fromstring(txt)
|
|
56
|
+
|
|
57
|
+
monkeypatch.setattr(CHPP, 'request', mock_request)
|
|
58
|
+
|
|
59
|
+
return CHPP(consumer_key='', consumer_secret='')
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from pychpp import CHPP
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_request_token(chpp: CHPP):
|
|
5
|
+
|
|
6
|
+
auth = chpp.get_auth(scope='')
|
|
7
|
+
|
|
8
|
+
assert isinstance(auth, dict)
|
|
9
|
+
for key in auth.keys():
|
|
10
|
+
assert key in ('oauth_token', 'oauth_token_secret', 'oauth_callback_confirmed', 'url',)
|
|
11
|
+
|
|
12
|
+
assert isinstance(auth['oauth_token'], str) and auth['oauth_token']
|
|
13
|
+
assert isinstance(auth['oauth_token_secret'],
|
|
14
|
+
str) and auth['oauth_token_secret']
|
|
15
|
+
assert (isinstance(auth['url'], str)
|
|
16
|
+
and 'https://chpp.hattrick.org/oauth/authorize.aspx'
|
|
17
|
+
'?scope=&oauth_token=' in auth['url'])
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from pychpp.models.custom.ht_arena import HTArena
|
|
4
|
+
from pychpp.models.custom.ht_team import HTTeam
|
|
5
|
+
|
|
6
|
+
from .conftest import ARENA_PATTERN, TEAM_PATTERN
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_get_current_user_arena(chpp):
|
|
10
|
+
arena = chpp.arena()
|
|
11
|
+
assert isinstance(arena, HTArena)
|
|
12
|
+
assert isinstance(arena.id, int) or arena.id is None
|
|
13
|
+
assert isinstance(arena.name, str)
|
|
14
|
+
assert isinstance(arena.url, str)
|
|
15
|
+
arena_match = re.match(ARENA_PATTERN, arena.url)
|
|
16
|
+
assert arena_match is not None
|
|
17
|
+
assert int(arena_match.group(1)) == arena.id
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def test_get_specific_arena(mocked_chpp):
|
|
21
|
+
arena = mocked_chpp.arena(295023)
|
|
22
|
+
assert isinstance(arena, HTArena)
|
|
23
|
+
assert arena.id == 295023
|
|
24
|
+
assert arena.name == 'Le Piquant'
|
|
25
|
+
|
|
26
|
+
arena_match = re.match(ARENA_PATTERN, arena.url)
|
|
27
|
+
assert arena_match is not None
|
|
28
|
+
assert int(arena_match.group(1)) == 295023
|
|
29
|
+
|
|
30
|
+
team = arena.team.details()
|
|
31
|
+
assert isinstance(team, HTTeam)
|
|
32
|
+
assert team.id == 295023
|
|
33
|
+
assert team.name == 'Les piments verts'
|
|
34
|
+
|
|
35
|
+
team_match = re.match(TEAM_PATTERN, team.url)
|
|
36
|
+
assert team_match is not None
|
|
37
|
+
assert int(team_match.group(1)) == 295023
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
from pychpp.models.custom.ht_challenge import HTChallengeManager
|
|
4
|
+
from pychpp.fixtures.ht_error import HTUnauthorizedAction
|
|
5
|
+
|
|
6
|
+
from .conftest import PYCHPP_SCOPE
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_is_challengeable(chpp):
|
|
10
|
+
|
|
11
|
+
challenge = HTChallengeManager(chpp)
|
|
12
|
+
team_ids_to_test = [1750803, 299981]
|
|
13
|
+
|
|
14
|
+
if "manage_challenges" in PYCHPP_SCOPE:
|
|
15
|
+
test = challenge.are_challengeable(team_ids=team_ids_to_test)
|
|
16
|
+
assert isinstance(test, dict)
|
|
17
|
+
for k, v in test.items():
|
|
18
|
+
assert k in team_ids_to_test
|
|
19
|
+
assert isinstance(v, bool)
|
|
20
|
+
else:
|
|
21
|
+
with pytest.raises(HTUnauthorizedAction):
|
|
22
|
+
challenge.are_challengeable(team_ids=team_ids_to_test)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from pychpp.models.xml.world_details import LeagueItemCountryRegionItem
|
|
4
|
+
|
|
5
|
+
from .conftest import COUNTRY_LEAGUE_PATTERN, REGION_PATTERN
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_get_league(chpp):
|
|
9
|
+
|
|
10
|
+
portugal_league = chpp.league(25, include_regions=True)
|
|
11
|
+
|
|
12
|
+
assert portugal_league.name == "Portugal"
|
|
13
|
+
assert portugal_league.id == 25
|
|
14
|
+
assert portugal_league.country.name == "Portugal"
|
|
15
|
+
|
|
16
|
+
portugal_regions = portugal_league.country.regions
|
|
17
|
+
assert len(portugal_regions) >= 1
|
|
18
|
+
assert isinstance(portugal_regions[0], LeagueItemCountryRegionItem)
|
|
19
|
+
|
|
20
|
+
assert len(portugal_league.cups) >= 1
|
|
21
|
+
|
|
22
|
+
assert re.match(COUNTRY_LEAGUE_PATTERN, portugal_league.url)
|
|
23
|
+
assert re.match(REGION_PATTERN, portugal_regions[0].url)
|
|
24
|
+
# assert re.match(CUP_PATTERN, portugal_league.cups[0].url)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from pychpp.models.custom.ht_league_unit import HTLeagueUnit
|
|
4
|
+
from pychpp.models.xml.league_details import TeamItem
|
|
5
|
+
|
|
6
|
+
from .conftest import LEAGUE_LEVEL_UNIT_PATTERN
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_league(chpp):
|
|
10
|
+
league_unit = chpp.league_unit(36378)
|
|
11
|
+
|
|
12
|
+
assert isinstance(league_unit, HTLeagueUnit)
|
|
13
|
+
assert league_unit.id == 36378
|
|
14
|
+
assert league_unit.name == "VI.390"
|
|
15
|
+
assert league_unit.league.id == 5
|
|
16
|
+
|
|
17
|
+
match_league_unit = re.match(LEAGUE_LEVEL_UNIT_PATTERN, league_unit.url)
|
|
18
|
+
|
|
19
|
+
assert match_league_unit is not None
|
|
20
|
+
assert int(match_league_unit.group(1)) == 36378
|
|
21
|
+
|
|
22
|
+
assert isinstance(league_unit.teams, list)
|
|
23
|
+
|
|
24
|
+
for r in league_unit.teams:
|
|
25
|
+
assert isinstance(r, TeamItem)
|
|
26
|
+
|
|
27
|
+
assert league_unit.teams[3].position == 4
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from pychpp.fixtures.ht_datetime import HTDatetime
|
|
4
|
+
from pychpp.models.custom.ht_match import HTMatch
|
|
5
|
+
|
|
6
|
+
from .conftest import MATCH_PATTERN
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_get_match(mocked_chpp):
|
|
10
|
+
|
|
11
|
+
m = mocked_chpp.match(547513790, events=True, version='3.1')
|
|
12
|
+
|
|
13
|
+
assert isinstance(m, HTMatch)
|
|
14
|
+
assert m.id == 547513790
|
|
15
|
+
|
|
16
|
+
m_match = re.match(MATCH_PATTERN, m.url)
|
|
17
|
+
assert m_match is not None
|
|
18
|
+
assert int(m_match.group(1)) == 547513790
|
|
19
|
+
|
|
20
|
+
assert m.date == HTDatetime.from_calendar(2015, 12, 19, 21, 0)
|
|
21
|
+
assert m.home_team.name == "Olympique Mig"
|
|
22
|
+
assert m.away_team.name == "Camden County Jerks"
|
|
23
|
+
assert m.added_minutes == 0
|
|
24
|
+
assert m.arena.id == 1162154
|
|
25
|
+
assert len(m.events) == 25
|
|
26
|
+
assert m.events[14].minute == 72
|
|
27
|
+
assert m.events[14].match_part == 2
|
|
28
|
+
assert m.events[14].type_id == 285
|
|
29
|
+
assert m.events[14].variation == 3
|
|
30
|
+
assert m.events[14].subject_team_id == 292366
|
|
31
|
+
assert m.events[14].subject_player_id == 373737451
|
|
32
|
+
assert m.events[14].object_player_id == 314946894
|
|
33
|
+
assert "coup franc" in m.events[14].text
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from pychpp.models.custom.ht_arena import HTArena
|
|
4
|
+
from pychpp.models.custom.ht_match import HTMatch
|
|
5
|
+
from pychpp.models.custom.ht_match_lineup import HTMatchLineup, HTMLEndingLineupPlayersItem, \
|
|
6
|
+
HTMLStartingLineupPlayersItem, HTMLSubstitutionItem, HTMLLineupPlayersItem
|
|
7
|
+
from pychpp.models.custom.ht_player import HTPlayer
|
|
8
|
+
|
|
9
|
+
from .conftest import MATCH_LINEUP_PATTERN, PLAYER_PATTERN, YOUTH_PLAYER_PATTERN
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_get_match_lineup(mocked_chpp):
|
|
13
|
+
match_lineup = mocked_chpp.match_lineup(match_id=660688698, team_id=86324, version='2.1')
|
|
14
|
+
|
|
15
|
+
assert isinstance(match_lineup, HTMatchLineup)
|
|
16
|
+
assert isinstance(match_lineup.match.details(version='3.1'), HTMatch)
|
|
17
|
+
|
|
18
|
+
assert match_lineup.match.id == 660688698
|
|
19
|
+
assert match_lineup.home_team.name == "Gazela.f.c"
|
|
20
|
+
assert match_lineup.away_team.id == 86324
|
|
21
|
+
assert match_lineup.away_team.name == "Apanha Bolas FC"
|
|
22
|
+
assert match_lineup.arena.id == 1420520
|
|
23
|
+
assert match_lineup.match.type == 1
|
|
24
|
+
|
|
25
|
+
ml_match = re.match(MATCH_LINEUP_PATTERN, match_lineup.url)
|
|
26
|
+
assert ml_match is not None
|
|
27
|
+
assert int(ml_match.group(1)) == 660688698
|
|
28
|
+
|
|
29
|
+
assert isinstance(match_lineup.arena.details(), HTArena)
|
|
30
|
+
|
|
31
|
+
# Ending lineup
|
|
32
|
+
assert len(match_lineup.team_lineup.ending_lineup_players) == 20
|
|
33
|
+
|
|
34
|
+
player_1 = match_lineup.team_lineup.ending_lineup_players[10]
|
|
35
|
+
assert isinstance(player_1, HTMLEndingLineupPlayersItem)
|
|
36
|
+
assert isinstance(player_1.details(), HTPlayer)
|
|
37
|
+
assert player_1.id == 453276953
|
|
38
|
+
assert player_1.first_name == "Urho"
|
|
39
|
+
assert player_1.role_id == 113
|
|
40
|
+
assert player_1.role_name == "LEFT_FORWARD"
|
|
41
|
+
assert re.match(PLAYER_PATTERN, player_1.url)
|
|
42
|
+
|
|
43
|
+
player_2 = match_lineup.team_lineup.ending_lineup_players[15]
|
|
44
|
+
assert player_2.role_id == 120
|
|
45
|
+
assert player_2.role_name == "SUBSTITUTION_EXTRA"
|
|
46
|
+
|
|
47
|
+
assert re.match(PLAYER_PATTERN,
|
|
48
|
+
match_lineup.team_lineup.ending_lineup_players[15].url)
|
|
49
|
+
|
|
50
|
+
# Starting lineup
|
|
51
|
+
assert len(match_lineup.team_lineup.starting_lineup_players) == 13
|
|
52
|
+
|
|
53
|
+
player_1 = match_lineup.team_lineup.starting_lineup_players[2]
|
|
54
|
+
assert isinstance(player_1, HTMLStartingLineupPlayersItem)
|
|
55
|
+
assert player_1.id == 453372830
|
|
56
|
+
assert player_1.first_name == "Gaspar"
|
|
57
|
+
assert player_1.role_id == 105
|
|
58
|
+
assert player_1.role_name == "LEFT_BACK_DEFENDER"
|
|
59
|
+
|
|
60
|
+
player_2 = match_lineup.team_lineup.starting_lineup_players[10]
|
|
61
|
+
assert player_2.role_id == 113
|
|
62
|
+
assert player_2.role_name == "LEFT_FORWARD"
|
|
63
|
+
assert re.match(PLAYER_PATTERN, player_2.url)
|
|
64
|
+
|
|
65
|
+
# Substitutions
|
|
66
|
+
substitutions = match_lineup.team_lineup.substitutions
|
|
67
|
+
assert len(substitutions) == 2
|
|
68
|
+
sub = substitutions[1]
|
|
69
|
+
assert isinstance(sub, HTMLSubstitutionItem)
|
|
70
|
+
assert sub.team_id == 86324
|
|
71
|
+
assert sub.subject_player_id == 453372834
|
|
72
|
+
assert sub.object_player_id == 453372838
|
|
73
|
+
assert sub.order_type == 1
|
|
74
|
+
assert sub.new_position_id == 108
|
|
75
|
+
assert sub.new_position_behaviour == 0
|
|
76
|
+
assert sub.minute == 73
|
|
77
|
+
assert sub.match_part == 2
|
|
78
|
+
|
|
79
|
+
ml2 = mocked_chpp.match_lineup(match_id=685566813, team_id=1750803, version='2.1')
|
|
80
|
+
|
|
81
|
+
assert ml2.match.id == 685566813
|
|
82
|
+
assert ml2.home_team.name == "Capdenaguet"
|
|
83
|
+
assert ml2.away_team.id == 1165592
|
|
84
|
+
assert ml2.away_team.name == "Les Poitevins de La Chapelle"
|
|
85
|
+
assert ml2.arena.id == 960796
|
|
86
|
+
assert ml2.match.type == 5
|
|
87
|
+
|
|
88
|
+
assert ml2.team_lineup.formations == [(0, "451"),
|
|
89
|
+
(50, "442"),
|
|
90
|
+
(50, "433"),
|
|
91
|
+
(50, "523"),
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
# specific case : injured player is not replaced
|
|
95
|
+
ml3 = mocked_chpp.match_lineup(match_id=690094305, team_id=296272, version='2.1')
|
|
96
|
+
|
|
97
|
+
assert ml3.team_lineup.formations == [(0, "433"),
|
|
98
|
+
(63, "333"),
|
|
99
|
+
]
|
|
100
|
+
|
|
101
|
+
ml4 = mocked_chpp.match_lineup(match_id=690183773, team_id=2053693, version='2.1')
|
|
102
|
+
|
|
103
|
+
assert ml4.team_lineup.formations == [(0, "253"),
|
|
104
|
+
(8, "153"),
|
|
105
|
+
]
|
|
106
|
+
|
|
107
|
+
# test swap substitution
|
|
108
|
+
ml5 = mocked_chpp.match_lineup(match_id=685860616, team_id=113143, version='2.1')
|
|
109
|
+
|
|
110
|
+
assert ml5.team_lineup.formations == [(0, "352")]
|
|
111
|
+
|
|
112
|
+
# other unreplaced player
|
|
113
|
+
ml6 = mocked_chpp.match_lineup(match_id=690328642, team_id=773670, version='2.1')
|
|
114
|
+
|
|
115
|
+
assert ml6.team_lineup.formations == [(0, "532"), (81, "432")]
|
|
116
|
+
|
|
117
|
+
# goalkeeper replaced by field player
|
|
118
|
+
ml7 = mocked_chpp.match_lineup(match_id=693127128, team_id=291394, version='2.1')
|
|
119
|
+
|
|
120
|
+
assert ml7.team_lineup.formations == [(0, "352"),
|
|
121
|
+
(77, "252"),
|
|
122
|
+
(81, "152"),
|
|
123
|
+
]
|
|
124
|
+
|
|
125
|
+
# substitute player become captain and is swapped
|
|
126
|
+
ml8 = mocked_chpp.match_lineup(match_id=695301077, team_id=294798, version='2.1')
|
|
127
|
+
|
|
128
|
+
assert ml8.team_lineup.formations == [(0, "343"),
|
|
129
|
+
(75, "253"),
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def test_get_youth_match_lineup(mocked_chpp):
|
|
134
|
+
match_lineup = mocked_chpp.match_lineup(match_id=136016609,
|
|
135
|
+
team_id=499165,
|
|
136
|
+
source_system='Youth', version='2.1',
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
youth_player = match_lineup.team_lineup.ending_lineup_players[0]
|
|
140
|
+
assert isinstance(youth_player, HTMLLineupPlayersItem)
|
|
141
|
+
assert youth_player.id == 353745299
|
|
142
|
+
assert youth_player.first_name == "Fritz"
|
|
143
|
+
assert youth_player.last_name == "Unterbuchner"
|
|
144
|
+
match_yp = re.match(YOUTH_PLAYER_PATTERN, youth_player.url)
|
|
145
|
+
assert match_yp is not None
|
|
146
|
+
assert int(match_yp.group(1)) == 353745299
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from pychpp.fixtures.ht_datetime import HTDatetime
|
|
4
|
+
|
|
5
|
+
from .conftest import MATCH_ARCHIVE_PATTERN, MATCH_PATTERN
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_get_other_user_matches_archives(chpp):
|
|
9
|
+
ma1 = chpp.matches_archive(
|
|
10
|
+
id_=1755906,
|
|
11
|
+
first_match_date=HTDatetime.from_calendar(2018, 4, 10),
|
|
12
|
+
last_match_date=HTDatetime.from_calendar(2018, 4, 30),
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
assert re.match(MATCH_ARCHIVE_PATTERN, ma1.url)
|
|
16
|
+
|
|
17
|
+
for m in ma1:
|
|
18
|
+
assert (HTDatetime.from_calendar(2018, 4, 10)
|
|
19
|
+
<= m.date <=
|
|
20
|
+
HTDatetime.from_calendar(2018, 6, 30))
|
|
21
|
+
assert 1755906 in (m.home_team.id, m.away_team.id)
|
|
22
|
+
assert re.match(MATCH_PATTERN, m.url)
|
|
23
|
+
|
|
24
|
+
ma2 = chpp.matches_archive(id_=1755906,
|
|
25
|
+
season=60,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
assert re.match(MATCH_ARCHIVE_PATTERN, ma2.url)
|
|
29
|
+
|
|
30
|
+
for m in ma2:
|
|
31
|
+
assert (HTDatetime.from_calendar(2015, 10, 26)
|
|
32
|
+
<= m.date <=
|
|
33
|
+
HTDatetime.from_calendar(2016, 2, 14))
|
|
34
|
+
assert 1755906 in (m.home_team.id, m.away_team.id)
|
|
35
|
+
assert re.match(MATCH_PATTERN, m.url)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from pychpp.models.custom.ht_region import HTRegion
|
|
4
|
+
|
|
5
|
+
from .conftest import REGION_PATTERN
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_get_current_user_region(chpp):
|
|
9
|
+
region = chpp.region()
|
|
10
|
+
assert isinstance(region, HTRegion)
|
|
11
|
+
assert isinstance(region.id, int)
|
|
12
|
+
assert isinstance(region.name, str)
|
|
13
|
+
assert isinstance(region.number_of_users, int)
|
|
14
|
+
assert isinstance(region.number_of_online, int)
|
|
15
|
+
assert isinstance(region.weather_id, int)
|
|
16
|
+
assert isinstance(region.tomorrow_weather_id, int)
|
|
17
|
+
assert isinstance(region.url, str)
|
|
18
|
+
|
|
19
|
+
region_match = re.match(REGION_PATTERN, region.url)
|
|
20
|
+
assert region_match is not None
|
|
21
|
+
assert int(region_match.group(1)) == region.id
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def test_get_specific_region(mocked_chpp):
|
|
25
|
+
region = mocked_chpp.region(id_=149)
|
|
26
|
+
assert isinstance(region, HTRegion)
|
|
27
|
+
assert region.id == 149
|
|
28
|
+
assert region.name == "Provence-Alpes-Côte d'Azur"
|
|
29
|
+
assert region.weather_id == 2
|
|
30
|
+
assert region.tomorrow_weather_id == 1
|
|
31
|
+
assert region.number_of_users == 895
|
|
32
|
+
assert region.number_of_online == 34
|
|
33
|
+
|
|
34
|
+
region_match = re.match(REGION_PATTERN, region.url)
|
|
35
|
+
assert region_match is not None
|
|
36
|
+
assert int(region_match.group(1)) == 149
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from pychpp.models.custom.ht_team import HTTeam
|
|
4
|
+
from pychpp.models.custom.ht_user import HTUser
|
|
5
|
+
from pychpp.models.custom.ht_youth_team import HTYouthTeam
|
|
6
|
+
from pychpp.models.custom.ht_arena import HTArena
|
|
7
|
+
|
|
8
|
+
from .conftest import TEAM_PATTERN, USER_PATTERN, YOUTH_TEAM_PATTERN, ARENA_PATTERN
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def test_get_secondary_team(mocked_chpp):
|
|
12
|
+
team = mocked_chpp.team(id_=1755350, version='3.7')
|
|
13
|
+
|
|
14
|
+
assert isinstance(team, HTTeam)
|
|
15
|
+
assert team.id == 1755350
|
|
16
|
+
assert team.name == "Projet NUL Bot Breton"
|
|
17
|
+
assert team.short_name == 'Bot Breton'
|
|
18
|
+
assert team.is_primary_club is False
|
|
19
|
+
|
|
20
|
+
team_match = re.match(TEAM_PATTERN, team.url)
|
|
21
|
+
assert team_match is not None
|
|
22
|
+
assert int(team_match.group(1)) == 1755350
|
|
23
|
+
|
|
24
|
+
user = team.user.details()
|
|
25
|
+
assert isinstance(user, HTUser)
|
|
26
|
+
assert user.id == 9638716
|
|
27
|
+
assert user.username == "F0977886-AA64-4C97-9187-DE8D88AC73DA"
|
|
28
|
+
|
|
29
|
+
user_match = re.match(USER_PATTERN, user.url)
|
|
30
|
+
assert user_match is not None
|
|
31
|
+
assert int(user_match.group(1)) == 9638716
|
|
32
|
+
|
|
33
|
+
youth_team = team.youth_team.details(version='1.2')
|
|
34
|
+
assert isinstance(youth_team, HTYouthTeam)
|
|
35
|
+
assert youth_team.id == 2745926
|
|
36
|
+
assert youth_team.name == "Les Petits Pédëstres"
|
|
37
|
+
|
|
38
|
+
youth_team_match = re.match(YOUTH_TEAM_PATTERN, youth_team.url)
|
|
39
|
+
assert youth_team_match is not None
|
|
40
|
+
assert int(youth_team_match.group(1)) == 2745926
|
|
41
|
+
|
|
42
|
+
arena = team.arena.details()
|
|
43
|
+
assert isinstance(arena, HTArena)
|
|
44
|
+
assert arena.name == "Stade Laurent Fièvre"
|
|
45
|
+
|
|
46
|
+
arena_match = re.match(ARENA_PATTERN, arena.url)
|
|
47
|
+
assert arena_match is not None
|
|
48
|
+
assert int(arena_match.group(1)) == 1751912
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from pychpp.models.custom.ht_user import HTUser
|
|
4
|
+
from .conftest import USER_PATTERN
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def test_get_current_user(chpp):
|
|
8
|
+
user = chpp.user()
|
|
9
|
+
|
|
10
|
+
assert isinstance(user, HTUser)
|
|
11
|
+
assert isinstance(user.id, int)
|
|
12
|
+
assert isinstance(user.login_name, str)
|
|
13
|
+
assert user.username == user.login_name
|
|
14
|
+
|
|
15
|
+
user_match = re.match(USER_PATTERN, user.url)
|
|
16
|
+
assert user_match is not None
|
|
17
|
+
assert int(user_match.group(1)) == user.id
|