fix low level issues

This commit is contained in:
Davide Scaini
2026-03-31 23:22:12 +02:00
parent 8f91503cf7
commit 81438231b4
19 changed files with 126 additions and 44 deletions
+20 -1
View File
@@ -1,4 +1,4 @@
from bincio.extract.sport import normalise_sport
from bincio.extract.sport import normalise_sport, normalise_sub_sport
def test_cycling_variants():
@@ -14,3 +14,22 @@ def test_running_variants():
def test_unknown_falls_back_to_other():
assert normalise_sport("yoga") == "other"
assert normalise_sport(None) == "other"
def test_sub_sport_strava_camelcase():
assert normalise_sub_sport("MountainBikeRide") == "mountain"
assert normalise_sub_sport("GravelRide") == "gravel"
assert normalise_sub_sport("VirtualRide") == "indoor"
assert normalise_sub_sport("Ride") == "road"
def test_sub_sport_ski_variants():
assert normalise_sub_sport("AlpineSki") == "alpine"
assert normalise_sub_sport("NordicSki") == "nordic"
assert normalise_sub_sport("BackcountrySki") == "nordic"
def test_sub_sport_unknown_returns_none():
assert normalise_sub_sport("yoga") is None
assert normalise_sub_sport(None) is None
assert normalise_sub_sport("generic") is None