31 lines
1018 B
Python
31 lines
1018 B
Python
def test_get_vehicles_returns_configured_vehicles(app):
|
|
with app.app_context():
|
|
from app.config_loader import get_vehicles
|
|
vehicles = get_vehicles()
|
|
assert "voiture" in vehicles
|
|
assert vehicles["voiture"]["co2_per_km"] == 142
|
|
|
|
|
|
def test_get_journeys_returns_profiles(app):
|
|
with app.app_context():
|
|
from app.config_loader import get_journeys
|
|
journeys = get_journeys()
|
|
assert "voiture_seule" in journeys
|
|
assert journeys["voiture_seule"]["distances"]["voiture"] == 25
|
|
|
|
|
|
def test_get_bareme_returns_tranches(app):
|
|
with app.app_context():
|
|
from app.config_loader import get_bareme
|
|
tranches = get_bareme(2025, 5)
|
|
assert len(tranches) == 3
|
|
assert tranches[0]["taux"] == 0.548
|
|
|
|
|
|
def test_day_types_without_journey(app):
|
|
with app.app_context():
|
|
from app.config_loader import day_types_without_journey
|
|
types = day_types_without_journey()
|
|
assert "TT" in types
|
|
assert "WORK" not in types
|