fix low level issues
This commit is contained in:
+20
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user