Skip to content

Commit

Permalink
FIX: add missing CountryCode to driver's info. (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
harningle authored Dec 26, 2023
1 parent 89033fd commit be98a4f
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 6 deletions.
7 changes: 4 additions & 3 deletions fastf1/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ def driver_info(path, response=None, livedata=None):
`['RacingNumber', 'BroadcastName', 'FullName', 'Tla', 'Line',
'TeamName', 'TeamColour', 'FirstName', 'LastName', 'Reference',
'HeadshotUrl']`
'HeadshotUrl', 'CountryCode']`
Args:
path (str): api path base string (usually ``Session.api_path``)
Expand Down Expand Up @@ -1491,8 +1491,9 @@ def driver_info(path, response=None, livedata=None):
drivers = collections.defaultdict(dict)

default_keys = [
'RacingNumber', 'BroadcastName', 'FullName', 'Tla', 'Line', 'TeamName',
'TeamColour', 'FirstName', 'LastName', 'Reference', 'HeadshotUrl'
'RacingNumber', 'BroadcastName', 'FullName', 'Tla', 'Line',
'TeamName', 'TeamColour', 'FirstName', 'LastName', 'Reference',
'HeadshotUrl', 'CountryCode'
]

for line in response:
Expand Down
68 changes: 68 additions & 0 deletions fastf1/testing/reference_data/2023_01_FP1/driver_list.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
00:00:05.485{"1":{"RacingNumber":"1","BroadcastName":"M VERSTAPPEN","FullName":"Max VERSTAPPEN","Tla":"VER","Line":1,"TeamName":"Red Bull Racing","TeamColour":"3671C6","FirstName":"Max","LastName":"Verstappen","Reference":"MAXVER01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/M/MAXVER01_Max_Verstappen/maxver01.png.transform/1col/image.png","CountryCode":"NED"},"2":{"RacingNumber":"2","BroadcastName":"L SARGEANT","FullName":"Logan SARGEANT","Tla":"SAR","Line":2,"TeamName":"Williams","TeamColour":"37BEDD","FirstName":"Logan","LastName":"Sargeant","Reference":"LOGSAR01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/L/LOGSAR01_Logan_Sargeant/logsar01.png.transform/1col/image.png","CountryCode":"USA"},"4":{"RacingNumber":"4","BroadcastName":"L NORRIS","FullName":"Lando NORRIS","Tla":"NOR","Line":3,"TeamName":"McLaren","TeamColour":"F58020","FirstName":"Lando","LastName":"Norris","Reference":"LANNOR01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/L/LANNOR01_Lando_Norris/lannor01.png.transform/1col/image.png","CountryCode":"GBR"},"10":{"RacingNumber":"10","BroadcastName":"P GASLY","FullName":"Pierre GASLY","Tla":"GAS","Line":4,"TeamName":"Alpine","TeamColour":"2293D1","FirstName":"Pierre","LastName":"Gasly","Reference":"PIEGAS01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/P/PIEGAS01_Pierre_Gasly/piegas01.png.transform/1col/image.png","CountryCode":"FRA"},"11":{"RacingNumber":"11","BroadcastName":"S PEREZ","FullName":"Sergio PEREZ","Tla":"PER","Line":5,"TeamName":"Red Bull Racing","TeamColour":"3671C6","FirstName":"Sergio","LastName":"Perez","Reference":"SERPER01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/S/SERPER01_Sergio_Perez/serper01.png.transform/1col/image.png","CountryCode":"MEX"},"14":{"RacingNumber":"14","BroadcastName":"F ALONSO","FullName":"Fernando ALONSO","Tla":"ALO","Line":6,"TeamName":"Aston Martin","TeamColour":"358C75","FirstName":"Fernando","LastName":"Alonso","Reference":"FERALO01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/F/FERALO01_Fernando_Alonso/feralo01.png.transform/1col/image.png","CountryCode":"ESP"},"16":{"RacingNumber":"16","BroadcastName":"C LECLERC","FullName":"Charles LECLERC","Tla":"LEC","Line":7,"TeamName":"Ferrari","TeamColour":"F91536","FirstName":"Charles","LastName":"Leclerc","Reference":"CHALEC01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/C/CHALEC01_Charles_Leclerc/chalec01.png.transform/1col/image.png","CountryCode":"MON"},"18":{"RacingNumber":"18","BroadcastName":"L STROLL","FullName":"Lance STROLL","Tla":"STR","Line":8,"TeamName":"Aston Martin","TeamColour":"358C75","FirstName":"Lance","LastName":"Stroll","Reference":"LANSTR01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/L/LANSTR01_Lance_Stroll/lanstr01.png.transform/1col/image.png","CountryCode":"CAN"},"20":{"RacingNumber":"20","BroadcastName":"K MAGNUSSEN","FullName":"Kevin MAGNUSSEN","Tla":"MAG","Line":9,"TeamName":"Haas F1 Team","TeamColour":"B6BABD","FirstName":"Kevin","LastName":"Magnussen","Reference":"KEVMAG01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/K/KEVMAG01_Kevin_Magnussen/kevmag01.png.transform/1col/image.png","CountryCode":"DEN"},"21":{"RacingNumber":"21","BroadcastName":"N DE VRIES","FullName":"Nyck DE VRIES","Tla":"DEV","Line":10,"TeamName":"AlphaTauri","TeamColour":"5E8FAA","FirstName":"Nyck","LastName":"De Vries","Reference":"NYCDEV01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/N/NYCDEV01_Nyck_De%20Vries/nycdev01.png.transform/1col/image.png","CountryCode":"NED"},"22":{"RacingNumber":"22","BroadcastName":"Y TSUNODA","FullName":"Yuki TSUNODA","Tla":"TSU","Line":11,"TeamName":"AlphaTauri","TeamColour":"5E8FAA","FirstName":"Yuki","LastName":"Tsunoda","Reference":"YUKTSU01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/Y/YUKTSU01_Yuki_Tsunoda/yuktsu01.png.transform/1col/image.png","CountryCode":"JPN"},"23":{"RacingNumber":"23","BroadcastName":"A ALBON","FullName":"Alexander ALBON","Tla":"ALB","Line":12,"TeamName":"Williams","TeamColour":"37BEDD","FirstName":"Alexander","LastName":"Albon","Reference":"ALEALB01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/A/ALEALB01_Alexander_Albon/alealb01.png.transform/1col/image.png","CountryCode":"THA"},"24":{"RacingNumber":"24","BroadcastName":"G ZHOU","FullName":"ZHOU Guanyu","Tla":"ZHO","Line":13,"TeamName":"Alfa Romeo","TeamColour":"C92D4B","FirstName":"Guanyu","LastName":"Zhou","Reference":"GUAZHO01","NameFormat":"LastNameIsPrimary","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/G/GUAZHO01_Guanyu_Zhou/guazho01.png.transform/1col/image.png","CountryCode":"CHN"},"27":{"RacingNumber":"27","BroadcastName":"N HULKENBERG","FullName":"Nico HULKENBERG","Tla":"HUL","Line":14,"TeamName":"Haas F1 Team","TeamColour":"B6BABD","FirstName":"Nico","LastName":"Hulkenberg","Reference":"NICHUL01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/N/NICHUL01_Nico_Hulkenberg/nichul01.png.transform/1col/image.png","CountryCode":"GER"},"31":{"RacingNumber":"31","BroadcastName":"E OCON","FullName":"Esteban OCON","Tla":"OCO","Line":15,"TeamName":"Alpine","TeamColour":"2293D1","FirstName":"Esteban","LastName":"Ocon","Reference":"ESTOCO01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/E/ESTOCO01_Esteban_Ocon/estoco01.png.transform/1col/image.png","CountryCode":"FRA"},"44":{"RacingNumber":"44","BroadcastName":"L HAMILTON","FullName":"Lewis HAMILTON","Tla":"HAM","Line":16,"TeamName":"Mercedes","TeamColour":"6CD3BF","FirstName":"Lewis","LastName":"Hamilton","Reference":"LEWHAM01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/L/LEWHAM01_Lewis_Hamilton/lewham01.png.transform/1col/image.png","CountryCode":"GBR"},"55":{"RacingNumber":"55","BroadcastName":"C SAINZ","FullName":"Carlos SAINZ","Tla":"SAI","Line":17,"TeamName":"Ferrari","TeamColour":"F91536","FirstName":"Carlos","LastName":"Sainz","Reference":"CARSAI01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/C/CARSAI01_Carlos_Sainz/carsai01.png.transform/1col/image.png","CountryCode":"ESP"},"63":{"RacingNumber":"63","BroadcastName":"G RUSSELL","FullName":"George RUSSELL","Tla":"RUS","Line":18,"TeamName":"Mercedes","TeamColour":"6CD3BF","FirstName":"George","LastName":"Russell","Reference":"GEORUS01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/G/GEORUS01_George_Russell/georus01.png.transform/1col/image.png","CountryCode":"GBR"},"77":{"RacingNumber":"77","BroadcastName":"V BOTTAS","FullName":"Valtteri BOTTAS","Tla":"BOT","Line":19,"TeamName":"Alfa Romeo","TeamColour":"C92D4B","FirstName":"Valtteri","LastName":"Bottas","Reference":"VALBOT01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/V/VALBOT01_Valtteri_Bottas/valbot01.png.transform/1col/image.png","CountryCode":"FIN"},"81":{"RacingNumber":"81","BroadcastName":"O PIASTRI","FullName":"Oscar PIASTRI","Tla":"PIA","Line":20,"TeamName":"McLaren","TeamColour":"F58020","FirstName":"Oscar","LastName":"Piastri","Reference":"OSCPIA01","HeadshotUrl":"https://www.formula1.com/content/dam/fom-website/drivers/O/OSCPIA01_Oscar_Piastri/oscpia01.png.transform/1col/image.png","CountryCode":"AUS"}}
00:15:01.141{"1":{"Line":2},"2":{"Line":3},"4":{"Line":4},"10":{"Line":5},"11":{"Line":6},"14":{"Line":7},"16":{"Line":8},"18":{"Line":9},"20":{"Line":10},"21":{"Line":11},"22":{"Line":12},"23":{"Line":1}}
00:15:04.688{"1":{"Line":3},"2":{"Line":2}}
00:15:06.329{"1":{"Line":4},"4":{"Line":5},"10":{"Line":6},"11":{"Line":7},"14":{"Line":8},"16":{"Line":9},"18":{"Line":10},"20":{"Line":11},"21":{"Line":12},"22":{"Line":13},"24":{"Line":14},"27":{"Line":15},"31":{"Line":16},"44":{"Line":17},"55":{"Line":18},"63":{"Line":19},"77":{"Line":3}}
00:15:11.125{"1":{"Line":5},"4":{"Line":6},"10":{"Line":7},"11":{"Line":8},"14":{"Line":9},"16":{"Line":10},"18":{"Line":11},"20":{"Line":12},"21":{"Line":13},"22":{"Line":14},"24":{"Line":4}}
00:15:13.282{"1":{"Line":6},"4":{"Line":5}}
00:15:23.391{"1":{"Line":7},"10":{"Line":8},"11":{"Line":9},"14":{"Line":10},"16":{"Line":11},"18":{"Line":12},"20":{"Line":13},"21":{"Line":14},"22":{"Line":15},"27":{"Line":16},"31":{"Line":17},"44":{"Line":18},"55":{"Line":19},"63":{"Line":20},"81":{"Line":6}}
00:15:36.156{"1":{"Line":8},"10":{"Line":9},"11":{"Line":10},"14":{"Line":11},"16":{"Line":12},"18":{"Line":13},"20":{"Line":14},"21":{"Line":7}}
00:15:44.515{"1":{"Line":9},"10":{"Line":10},"11":{"Line":8}}
00:15:52.328{"1":{"Line":10},"10":{"Line":11},"14":{"Line":12},"16":{"Line":13},"18":{"Line":14},"20":{"Line":15},"22":{"Line":9}}
00:16:03.718{"1":{"Line":11},"10":{"Line":12},"14":{"Line":13},"16":{"Line":14},"18":{"Line":15},"20":{"Line":16},"27":{"Line":17},"31":{"Line":10}}
00:16:04.343{"1":{"Line":12},"10":{"Line":11}}
00:16:10.093{"1":{"Line":13},"14":{"Line":12}}
00:16:16.609{"1":{"Line":14},"16":{"Line":13}}
00:16:19.374{"1":{"Line":15},"18":{"Line":16},"20":{"Line":17},"27":{"Line":14}}
00:16:20.421{"1":{"Line":16},"18":{"Line":17},"20":{"Line":18},"44":{"Line":19},"55":{"Line":15}}
00:17:09.217{"1":{"Line":17},"18":{"Line":18},"20":{"Line":16}}
00:18:59.606{"2":{"Line":3},"4":{"Line":1},"23":{"Line":2},"24":{"Line":5},"77":{"Line":4}}
00:19:12.418{"2":{"Line":4},"4":{"Line":2},"11":{"Line":1},"21":{"Line":8},"23":{"Line":3},"24":{"Line":6},"77":{"Line":5},"81":{"Line":7}}
00:19:18.449{"2":{"Line":5},"21":{"Line":3},"23":{"Line":4},"24":{"Line":7},"77":{"Line":6},"81":{"Line":8}}
00:19:23.433{"2":{"Line":6},"4":{"Line":3},"21":{"Line":4},"23":{"Line":5},"24":{"Line":8},"77":{"Line":7},"81":{"Line":2}}
00:19:32.480{"2":{"Line":7},"21":{"Line":5},"22":{"Line":4},"23":{"Line":6},"24":{"Line":9},"77":{"Line":8}}
00:19:41.105{"2":{"Line":8},"4":{"Line":4},"10":{"Line":2},"21":{"Line":6},"22":{"Line":5},"23":{"Line":7},"24":{"Line":10},"31":{"Line":11},"77":{"Line":9},"81":{"Line":3}}
00:19:50.386{"2":{"Line":9},"4":{"Line":5},"10":{"Line":3},"11":{"Line":2},"14":{"Line":1},"21":{"Line":7},"22":{"Line":6},"23":{"Line":8},"24":{"Line":11},"31":{"Line":12},"77":{"Line":10},"81":{"Line":4}}
00:19:59.198{"2":{"Line":10},"16":{"Line":7},"21":{"Line":8},"23":{"Line":9},"24":{"Line":12},"31":{"Line":13},"77":{"Line":11}}
00:20:05.651{"2":{"Line":11},"4":{"Line":6},"16":{"Line":8},"21":{"Line":9},"22":{"Line":7},"23":{"Line":10},"24":{"Line":13},"27":{"Line":15},"31":{"Line":14},"55":{"Line":4},"77":{"Line":12},"81":{"Line":5}}
00:22:49.992{"1":{"Line":3},"2":{"Line":12},"4":{"Line":7},"10":{"Line":4},"16":{"Line":9},"20":{"Line":17},"21":{"Line":10},"22":{"Line":8},"23":{"Line":11},"24":{"Line":14},"27":{"Line":16},"31":{"Line":15},"55":{"Line":5},"77":{"Line":13},"81":{"Line":6}}
00:23:01.476{"4":{"Line":5},"55":{"Line":6},"81":{"Line":7}}
00:24:19.178{"4":{"Line":6},"16":{"Line":5},"22":{"Line":9},"55":{"Line":7},"81":{"Line":8}}
00:25:04.505{"4":{"Line":7},"16":{"Line":6},"55":{"Line":8},"81":{"Line":5}}
00:26:04.629{"11":{"Line":1},"14":{"Line":2}}
00:26:20.488{"2":{"Line":13},"4":{"Line":8},"10":{"Line":5},"16":{"Line":7},"18":{"Line":19},"20":{"Line":18},"21":{"Line":11},"22":{"Line":10},"23":{"Line":12},"24":{"Line":15},"27":{"Line":17},"31":{"Line":16},"44":{"Line":4},"55":{"Line":9},"77":{"Line":14},"81":{"Line":6}}
00:26:36.988{"2":{"Line":9},"21":{"Line":12},"22":{"Line":11},"23":{"Line":13},"55":{"Line":10}}
00:26:43.097{"2":{"Line":10},"4":{"Line":9},"16":{"Line":8},"55":{"Line":6},"81":{"Line":7}}
00:28:49.439{"21":{"Line":13},"22":{"Line":12},"23":{"Line":14},"77":{"Line":11}}
00:29:39.094{"2":{"Line":11},"4":{"Line":10},"16":{"Line":9},"18":{"Line":20},"20":{"Line":19},"21":{"Line":14},"22":{"Line":13},"23":{"Line":15},"24":{"Line":16},"27":{"Line":18},"31":{"Line":17},"55":{"Line":7},"63":{"Line":6},"77":{"Line":12},"81":{"Line":8}}
00:29:42.985{"22":{"Line":12},"77":{"Line":13}}
00:29:47.016{"2":{"Line":12},"4":{"Line":11},"16":{"Line":10},"21":{"Line":15},"22":{"Line":13},"23":{"Line":8},"77":{"Line":14},"81":{"Line":9}}
00:30:21.765{"2":{"Line":7},"4":{"Line":12},"16":{"Line":11},"23":{"Line":9},"55":{"Line":8},"81":{"Line":10}}
00:31:16.999{"2":{"Line":8},"16":{"Line":6},"23":{"Line":10},"55":{"Line":9},"63":{"Line":7},"81":{"Line":11}}
00:31:53.795{"2":{"Line":9},"4":{"Line":13},"16":{"Line":7},"21":{"Line":16},"22":{"Line":14},"23":{"Line":11},"24":{"Line":17},"27":{"Line":6},"31":{"Line":18},"55":{"Line":10},"63":{"Line":8},"77":{"Line":15},"81":{"Line":12}}
00:32:18.591{"1":{"Line":4},"2":{"Line":10},"4":{"Line":14},"10":{"Line":6},"16":{"Line":8},"20":{"Line":3},"21":{"Line":17},"22":{"Line":15},"23":{"Line":12},"24":{"Line":18},"27":{"Line":7},"31":{"Line":19},"44":{"Line":5},"55":{"Line":11},"63":{"Line":9},"77":{"Line":16},"81":{"Line":13}}
00:32:31.763{"2":{"Line":11},"4":{"Line":15},"21":{"Line":18},"22":{"Line":16},"23":{"Line":13},"24":{"Line":19},"31":{"Line":9},"55":{"Line":12},"63":{"Line":10},"77":{"Line":17},"81":{"Line":14}}
00:33:10.481{"1":{"Line":5},"20":{"Line":4},"44":{"Line":3}}
00:33:21.293{"2":{"Line":12},"55":{"Line":10},"63":{"Line":11}}
00:33:34.840{"31":{"Line":10},"55":{"Line":11},"63":{"Line":9}}
00:36:14.962{"21":{"Line":19},"24":{"Line":17},"77":{"Line":18}}
00:44:47.890{"1":{"Line":2},"14":{"Line":3},"20":{"Line":5},"44":{"Line":4}}
00:44:59.281{"2":{"Line":13},"10":{"Line":7},"16":{"Line":9},"20":{"Line":6},"23":{"Line":14},"27":{"Line":8},"31":{"Line":11},"44":{"Line":5},"55":{"Line":12},"63":{"Line":10},"81":{"Line":4}}
00:48:17.824{"2":{"Line":14},"4":{"Line":16},"10":{"Line":8},"16":{"Line":10},"20":{"Line":7},"21":{"Line":6},"22":{"Line":17},"23":{"Line":15},"24":{"Line":18},"27":{"Line":9},"31":{"Line":12},"55":{"Line":13},"63":{"Line":11},"77":{"Line":19}}
00:48:49.089{"2":{"Line":9},"16":{"Line":11},"27":{"Line":10},"31":{"Line":13},"55":{"Line":14},"63":{"Line":12}}
00:48:59.214{"2":{"Line":10},"4":{"Line":17},"10":{"Line":9},"16":{"Line":12},"20":{"Line":8},"21":{"Line":7},"22":{"Line":6},"23":{"Line":16},"27":{"Line":11},"31":{"Line":14},"55":{"Line":15},"63":{"Line":13}}
00:50:20.603{"2":{"Line":11},"4":{"Line":18},"10":{"Line":10},"14":{"Line":4},"16":{"Line":13},"20":{"Line":9},"21":{"Line":8},"22":{"Line":7},"23":{"Line":17},"24":{"Line":19},"27":{"Line":12},"31":{"Line":15},"44":{"Line":6},"55":{"Line":16},"63":{"Line":14},"77":{"Line":3},"81":{"Line":5}}
00:54:45.832{"4":{"Line":19},"18":{"Line":17},"23":{"Line":18},"24":{"Line":20}}
00:55:19.222{"2":{"Line":12},"4":{"Line":3},"10":{"Line":11},"14":{"Line":5},"16":{"Line":14},"18":{"Line":18},"20":{"Line":10},"21":{"Line":9},"22":{"Line":8},"23":{"Line":19},"27":{"Line":13},"31":{"Line":16},"44":{"Line":7},"55":{"Line":17},"63":{"Line":15},"77":{"Line":4},"81":{"Line":6}}
00:58:36.766{"2":{"Line":13},"10":{"Line":12},"14":{"Line":6},"16":{"Line":15},"18":{"Line":19},"20":{"Line":11},"21":{"Line":10},"22":{"Line":9},"23":{"Line":20},"24":{"Line":4},"27":{"Line":14},"31":{"Line":17},"44":{"Line":8},"55":{"Line":18},"63":{"Line":16},"77":{"Line":5},"81":{"Line":7}}
01:00:36.826{"2":{"Line":14},"10":{"Line":13},"16":{"Line":16},"18":{"Line":12},"27":{"Line":15},"31":{"Line":18},"55":{"Line":19},"63":{"Line":17}}
01:01:09.701{"2":{"Line":15},"10":{"Line":14},"14":{"Line":7},"16":{"Line":4},"18":{"Line":13},"20":{"Line":12},"21":{"Line":11},"22":{"Line":10},"24":{"Line":5},"27":{"Line":16},"44":{"Line":9},"77":{"Line":6},"81":{"Line":8}}
01:02:21.699{"2":{"Line":16},"10":{"Line":15},"18":{"Line":14},"20":{"Line":13},"21":{"Line":12},"27":{"Line":17},"63":{"Line":11}}
01:03:52.119{"14":{"Line":8},"20":{"Line":5},"21":{"Line":13},"22":{"Line":11},"24":{"Line":6},"44":{"Line":10},"63":{"Line":12},"77":{"Line":7},"81":{"Line":9}}
01:04:04.276{"2":{"Line":17},"10":{"Line":16},"18":{"Line":15},"21":{"Line":14},"27":{"Line":12},"63":{"Line":13}}
01:04:28.416{"2":{"Line":18},"10":{"Line":17},"18":{"Line":16},"21":{"Line":15},"31":{"Line":14}}
01:04:38.572{"1":{"Line":3},"4":{"Line":4},"14":{"Line":2},"16":{"Line":5},"20":{"Line":6},"24":{"Line":7},"77":{"Line":8}}
01:06:42.929{"44":{"Line":9},"81":{"Line":10}}
01:07:24.428{"10":{"Line":16},"18":{"Line":17}}
01:08:53.880{"22":{"Line":12},"27":{"Line":13},"63":{"Line":10},"81":{"Line":11}}
01:09:24.707{"10":{"Line":17},"18":{"Line":6},"20":{"Line":7},"21":{"Line":16},"22":{"Line":13},"24":{"Line":8},"27":{"Line":14},"31":{"Line":15},"44":{"Line":10},"63":{"Line":11},"77":{"Line":9},"81":{"Line":12}}
01:11:34.267{"23":{"Line":19},"55":{"Line":20}}
7 changes: 4 additions & 3 deletions fastf1/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def test_driver_list():
response = list()
tl = 12 # length of timestamp: len('00:00:00:000')
with open('fastf1/testing/reference_data/'
'2020_05_FP2/driver_list.raw', 'rb') as fobj:
'2023_01_FP1/driver_list.raw', 'rb') as fobj:
for line in fobj.readlines():
dec = line.decode('utf-8-sig')
response.append([dec[:tl], fastf1._api.parse(dec[tl:])])
Expand All @@ -239,12 +239,13 @@ def test_driver_list():

# ########## verify driver data
assert isinstance(data, dict)
assert len(data.keys()) == 20
assert len(data.keys()) == 20 # 20 drivers in this GP
dtypes = {'RacingNumber': str, 'BroadcastName': str, 'FullName': str,
'Tla': str, 'Line': int, 'TeamName': str, 'TeamColour': str,
'FirstName': str, 'LastName': str, 'Reference': str,
'HeadshotUrl': str}
'HeadshotUrl': str, 'CountryCode': str}
for driver in data.values():
assert len(driver.keys()) == 12 # 12 fields in each driver's info.
for key, val in driver.items():
assert isinstance(val, dtypes[key])

Expand Down

0 comments on commit be98a4f

Please sign in to comment.