Skip to content

Commit

Permalink
Testing fixed for Rider.points_per_speciality.
Browse files Browse the repository at this point in the history
  • Loading branch information
themm1 committed Aug 28, 2023
1 parent 559d84a commit ae60526
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 34 deletions.
1 change: 0 additions & 1 deletion tests/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def run(args: argparse.Namespace, fixturer_path: str = "./tests/fixtures/"):
except Exception as e:
print(f"Exception raised: {url}")
raise(e)
assert parsed_obj1.keys() == parsed_obj2.keys()
update_needed = False
for method in parsed_obj1.keys():
try:
Expand Down
9 changes: 8 additions & 1 deletion tests/fixtures/rider_alberto-contador.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@
"rank": 1416
}
],
"points_per_speciality": {
"one_day_races": 770,
"gc": 11393,
"time_trial": 6056,
"sprint": 1232,
"climber": 10160
},
"teams_history": [
{
"season": 2017,
Expand Down Expand Up @@ -216,5 +223,5 @@
"until": "12-31"
}
],
"weight": 61
"weight": 61.0
}
51 changes: 36 additions & 15 deletions tests/fixtures/rider_alberto-contador.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
<title>Alberto Contador </title>
<base href="https://www.procyclingstats.com/rider.php">
<link rel="canonical" href="https://www.procyclingstats.com/rider/alberto-contador">
<script>
var r89 = r89 || {
callAds: [],
pushAd: function(id, name, config) { r89.callAds.push([id, name, config]); }
};
</script>
<script async="" src="https://tags.refinery89.com/v2/procyclingstats.js"></script><meta name="description" content="Alberto Contador (born 1982-12-06 in Pinto) is a former professional road racing cyclist from Spain, active between 2001 and 2017. His best results are 2 wins in GC Tour de France and 3 wins in GC La Vuelta ciclista a España.">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand All @@ -34,9 +40,9 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<base href="rider.php">
<link rel="stylesheet" type="text/css" href="https://www.procyclingstats.com/pcs_a185.css">
<link rel="stylesheet" type="text/css" href="https://www.procyclingstats.com/pcs_b145.css">
<script src="https://www.procyclingstats.com/pcs_s72.js"></script>
<link rel="stylesheet" type="text/css" href="https://www.procyclingstats.com/pcs_a187.css">
<link rel="stylesheet" type="text/css" href="https://www.procyclingstats.com/pcs_b158.css">
<script src="https://www.procyclingstats.com/pcs_s75.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css">
<link rel="apple-touch-icon" sizes="180x180" href="https://www.procyclingstats.com/images/pcs-logos/icon3/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://www.procyclingstats.com/images/pcs-logos/icon3/favicon-32x32.png">
Expand All @@ -61,8 +67,8 @@
<li><a href="race/milano-sanremo">Milano-Sanremo</a></li>
<li><a href="race/amstel-gold-race">Amstel Gold Race</a></li>
<li><a href="race/tirreno-adriatico">Tirreno-Adriatico</a></li>
<li><a href="race/liege-bastogne-liege">Liège-Bastogne-Liège</a></li>
<li><a href="race/il-lombardia">Il Lombardia</a></li>
<li><a href="race/liege-bastogne-liege">Liège-Bastogne-Liège</a></li>
<li><a href="race/la-fleche-wallone">La Flèche Wallonne</a></li>
<li><a href="race/paris-nice">Paris - Nice</a></li>
<li><a href="race/paris-roubaix">Paris-Roubaix</a></li>
Expand All @@ -72,24 +78,24 @@
<li><a href="race/gent-wevelgem">Gent-Wevelgem in Flanders Fields</a></li>
<li><a href="race/san-sebastian">Clásica Ciclista San Sebastián</a></li>
</ul></li>
<li class="more4 "><a class="reg" href="teams.php">Teams</a><a class="more4 toggleNavDropdown" href="">▼</a><ul class="hide"><li><a href="team/ef-education-easypost-2023">EF Education-EasyPost</a></li>
<li class="more4 "><a class="reg" href="teams.php">Teams</a><a class="more4 toggleNavDropdown" href="">▼</a><ul class="hide"><li><a href="team/alpecin-deceuninck-2023">Alpecin-Deceuninck</a></li>
<li><a href="team/ag2r-citroen-team-2023">AG2R Citroën Team</a></li>
<li><a href="team/bora-hansgrohe-2023">BORA - hansgrohe</a></li>
<li><a href="team/astana-qazaqstan-team-2023">Astana Qazaqstan Team</a></li>
<li><a href="team/cofidis-2023">Cofidis </a></li>
<li><a href="team/ef-education-easypost-2023">EF Education-EasyPost</a></li>
<li><a href="team/groupama-fdj-2023">Groupama - FDJ</a></li>
<li><a href="team/ineos-grenadiers-2023">INEOS Grenadiers</a></li>
<li><a href="team/intermarche-circus-wanty-2023">Intermarché - Circus - Wanty </a></li>
<li><a href="team/bahrain-victorious-2023">Bahrain - Victorious</a></li>
<li><a href="team/team-jumbo-visma-2023">Jumbo-Visma</a></li>
<li><a href="team/movistar-team-2023">Movistar Team</a></li>
<li><a href="team/soudal-quick-step-2023">Soudal - Quick Step</a></li>
<li><a href="team/team-arkea-samsic-2023">Team Arkéa Samsic</a></li>
<li><a href="team/team-jayco-alula-2023">Team Jayco AlUla</a></li>
<li><a href="team/team-dsm-2023">Team DSM</a></li>
<li><a href="team/ag2r-citroen-team-2023">AG2R Citroën Team</a></li>
<li><a href="team/trek-segafredo-2023">Trek - Segafredo</a></li>
<li><a href="team/alpecin-deceuninck-2023">Alpecin-Deceuninck</a></li>
<li><a href="team/uae-team-emirates-2023">UAE Team Emirates</a></li>
<li><a href="team/astana-qazaqstan-team-2023">Astana Qazaqstan Team</a></li>
<li><a href="team/bahrain-victorious-2023">Bahrain - Victorious</a></li>
<li><a href="team/bora-hansgrohe-2023">BORA - hansgrohe</a></li>
<li><a href="team/cofidis-2023">Cofidis </a></li>
</ul></li>
<li class=" "><a class="reg" href="rankings.php">Rankings</a></li>
<li class="more4 "><a class="reg" href="statistics.php">Statistics</a><a class="more4 toggleNavDropdown" href="">▼</a><ul class="hide"><li><a href="statistics">Overview</a></li>
Expand All @@ -98,8 +104,15 @@
<li><a href="statistics/grandtours">Grand tours</a></li>
</ul></li>
<li class=" "><a class="reg" href="game.php">Game</a></li>
<li class="more4 red"><a class="reg" href="race/vuelta-a-espana/2023">Vuelta</a><a class="more4 toggleNavDropdown" href="">▼</a><ul class="hide"><li><a href="race/vuelta-a-espana/2023/startlist">Startlist</a></li>
<li><a href="race/vuelta-a-espana/results/palmares">Palmares</a></li>
<li><a href="race/vuelta-a-espana/2023/startlist/top-competitors">Top competitors</a></li>
<li><a href="race/vuelta-a-espana/2023/startlist/top-gc-riders">Final GC favorites</a></li>
<li><a href="race/vuelta-a-espana/2023/route/stage-profiles">Stage profiles</a></li>
<li><a href="race/vuelta-a-espana/2023/teams/top-teams">Best teams</a></li>
<li><a href="race/vuelta-a-espana/2023/startlist/form">Riders form</a></li>
</ul></li>
<li class="more4 "><a class="reg" href="riders.php">More</a><a class="more4 toggleNavDropdown" href="">▼</a><ul class="hide"><li><a href="riders">Riders</a></li>
<li><a href="info/paris-hardenberg">Paris-Hardenberg</a></li>
<li><a href="info/contact">Contact us</a></li>
<li><a href="info/countdown-to-1-billion-pageviews">Countdown to 2 billion pageviews</a></li>
<li><a href="favorite500.php">Favorite500</a></li>
Expand Down Expand Up @@ -156,7 +169,8 @@
<li data-n="7"><a href="rider/alberto-contador/specialties/specialties">Specialties - Specialties</a></li><li data-n="6"><a href="rider/alberto-contador/specialties/top-gc-results">Top GC results</a></li>
<li data-n="6"><a href="rider/alberto-contador/specialties/fastest-tt">Fastest TT</a></li>
</ul></li></ul><div class="clear"></div></div><div class="page-title "><div class="main"><span class="flag es w32"></span><span class="flag es w24"></span><h1 class="">Alberto Contador</h1></div></div><div class="clear"></div><div class="desktop-ad leaderbord rider"></div><div class="mob-ad leaderbord rider"></div><div class="top-cont"></div><div class="top-cont-mobile top-cont-mobile-rider"></div><div class="page-content page-object default " data-no_menu="1"><h2></h2><div class=" ">
<div class="left w75 mb_w100"><div class="left w50 mb_w100"><h3>Rider</h3><div class="rdr-img-cont"><a href="rider/alberto-contador/statistics/overview"><img alt="Profile photo of Alberto Contador" src="images/riders/bp/da/alberto-contador-2017.jpg"></a></div><div class="rdr-info-cont"><b>Date of birth:</b> 6<sup>th</sup> December 1982 (40)<br><b>Nationality:</b> <span class="flag es"></span><a class="black" href="nation/spain">Spain</a><br><span><b>Weight:</b> 61 kg &nbsp; <span><b>Height:</b> 1.76 m<br><b>Place of birth:</b> <a href="location/pinto">Pinto</a><br><div class="pps"><h4>Points per specialty</h4><ul><li><div class="bar "><div class="bg green" style="width: 6.758535943123%; height: 100%; "></div></div><div class="pnt">770</div><div class="title"><a href="rider/alberto-contador/results/career-points-one-day-races">One day races</a></div></li><li><div class="bar "><div class="bg red" style="width: 100%; height: 100%; "></div></div><div class="pnt">11393</div><div class="title"><a href="rider/alberto-contador/results/career-points-gc">GC</a></div></li><li><div class="bar "><div class="bg blue" style="width: 53.155446326692%; height: 100%; "></div></div><div class="pnt">6056</div><div class="title"><a href="rider/alberto-contador/results/career-points-time-trial">Time trial</a></div></li><li><div class="bar "><div class="bg orange" style="width: 10.822434828403%; height: 100%; "></div></div><div class="pnt">1233</div><div class="title"><a href="rider/alberto-contador/results/career-points-sprint">Sprint</a></div></li><li><div class="bar "><div class="bg purple" style="width: 89.19511981041%; height: 100%; "></div></div><div class="pnt">10162</div><div class="title"><a href="rider/alberto-contador/results/career-points-climbers">Climber</a></div></li></ul></div><div class=""></div>
<ul class="list horizontal fs14 circle bluelink"></ul>
<div class="left w75 mb_w100"><div class="left w50 mb_w100"><h3>Rider</h3><div class="rdr-img-cont"><a href="rider/alberto-contador/statistics/overview"><img alt="Profile photo of Alberto Contador" src="images/riders/bp/da/alberto-contador-2017.jpg"></a></div><div class="rdr-info-cont"><b>Date of birth:</b> 6<sup>th</sup> December 1982 (40)<br><b>Nationality:</b> <span class="flag es"></span><a class="black" href="nation/spain">Spain</a><br><span><b>Weight:</b> 61 kg &nbsp; <span><b>Height:</b> 1.76 m<br><b>Place of birth:</b> <a href="location/pinto">Pinto</a><br><div class="pps"><h4>Points per specialty</h4><ul><li><div class="bar "><div class="bg green" style="width: 6.758535943123%; height: 100%; "></div></div><div class="pnt">770</div><div class="title"><a href="rider/alberto-contador/results/career-points-one-day-races">One day races</a></div></li><li><div class="bar "><div class="bg red" style="width: 100%; height: 100%; "></div></div><div class="pnt">11393</div><div class="title"><a href="rider/alberto-contador/results/career-points-gc">GC</a></div></li><li><div class="bar "><div class="bg blue" style="width: 53.155446326692%; height: 100%; "></div></div><div class="pnt">6056</div><div class="title"><a href="rider/alberto-contador/results/career-points-time-trial">Time trial</a></div></li><li><div class="bar "><div class="bg orange" style="width: 10.813657508997%; height: 100%; "></div></div><div class="pnt">1232</div><div class="title"><a href="rider/alberto-contador/results/career-points-sprint">Sprint</a></div></li><li><div class="bar "><div class="bg purple" style="width: 89.177565171597%; height: 100%; "></div></div><div class="pnt">10160</div><div class="title"><a href="rider/alberto-contador/results/career-points-climbers">Climber</a></div></li></ul></div><div class=""></div>
<div class="mt10"><ul class="list horizontal sites"><li><span class="icon twitter left"></span><a target="_blank" class="" href="https://twitter.com/albertocontador">twitter</a></li>
<li><span class="icon strava left"></span><a target="_blank" class="" href="https://www.strava.com/athletes/24030059">strava</a></li>
<li><span class="icon instagram left"></span><a target="_blank" class="" href="https://www.instagram.com/acontadoroficial/">instagram</a></li>
Expand All @@ -165,7 +179,7 @@
<span class="table-cont"><ul class="list horizontal rdr-rankings" style=" "><li class=""><div class="title "><a href="rankings/me/all-time">All time</a></div><div class="rnk ">29</div><div class="clear"></div></li>
</ul></span></div>
<div class="">
<span class="table-cont"><ul class="list horizontal" style=" "><li class=""><div class="bold ">Visits:</div><div><span class="delta-up">▲77</span></div><div> &nbsp;this week</div><div class="clear"></div></li>
<span class="table-cont"><ul class="list horizontal" style=" "><li class=""><div class="bold ">Visits:</div><div><span class="delta-down">▼145</span></div><div> &nbsp;this week</div><div class="clear"></div></li>
</ul></span></div>
</span></span></div><div class="clear"></div></div><div class="right w47 mb_w100"><h3>Top results</h3><ul class="list moblist flex" data-shortnr="8" style="line-height: 17px; "><li class="main"><div class="ar" style="width: 55px; "><b>2x</b>&nbsp;<span class="shirt st4 w14"></span></div><div><span class="blue">GC</span> <a href="race/tour-de-france/2009/gc">Tour de France</a><span style="color: #777; font: 11px tahoma;">&nbsp; ('09, '07)</span></div></li>
<li class="main"><div class="ar" style="width: 55px; "><b>3x</b>&nbsp;<span class="shirt st4 w14"></span></div><div><span class="blue">GC</span> <a href="race/vuelta-a-espana/2014/gc">La Vuelta ciclista a España</a><span style="color: #777; font: 11px tahoma;">&nbsp; ('14, '12, '08)</span></div></li>
Expand Down Expand Up @@ -337,6 +351,13 @@
<div class="mt30"><h3>Family</h3>
<span class="table-cont"><ul class="list" style=" "><li class=""><div><a href="rider/francisco-javier-contador">Francisco Javier Contador</a></div><div>&nbsp;(Brother)</div><div class="clear"></div></li>
</ul></span></div>
<div class="mt30"><h3>H2H Suggestions</h3>
<span class="table-cont"><ul class="list" style=" "><li class=""><div><a href="rider-vs-rider/alberto-contador/christopher-froome">FROOME Chris</a></div><div class="clear"></div></li>
<li class=""><div><a href="rider-vs-rider/alberto-contador/andy-schleck">SCHLECK Andy</a></div><div class="clear"></div></li>
<li class=""><div><a href="rider-vs-rider/alberto-contador/joaquim-rodriguez">RODRÍGUEZ Joaquim</a></div><div class="clear"></div></li>
<li class=""><div><a href="rider-vs-rider/alberto-contador/vincenzo-nibali">NIBALI Vincenzo</a></div><div class="clear"></div></li>
<li class=""><div><a href="rider-vs-rider/alberto-contador/alejandro-valverde">VALVERDE Alejandro</a></div><div class="clear"></div></li>
</ul></span></div>
</div><div class="clear"></div><script>
$(document).ready(function(){
var id = 137456;
Expand Down Expand Up @@ -469,7 +490,7 @@ $(document).ready(function(){
<li><a href="info/cookie-policy">Cookie policy</a></li>
<li><a href="info/sitemap">Sitemap</a></li>
<li><a href="info/contributions">Contributions</a></li>
<li><span>Pageload 0.2043s</span></li>
<li><span>Pageload 0.0787s</span></li>
</ul></li>
</ul><input type="hidden" id="pageid" value="1238"><input type="hidden" id="userid" value="0">
</div>
Expand Down
9 changes: 8 additions & 1 deletion tests/fixtures/rider_david-canada.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@
"rank": 1111
}
],
"points_per_speciality": {
"one_day_races": 291,
"gc": 1708,
"time_trial": 820,
"sprint": 472,
"climber": 356
},
"teams_history": [
{
"season": 2009,
Expand Down Expand Up @@ -193,5 +200,5 @@
"until": "12-31"
}
],
"weight": 65
"weight": 65.0
}
Loading

0 comments on commit ae60526

Please sign in to comment.