feat: TOML config loader for vehicles, journeys, and tax scales
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
30
tests/test_config_loader.py
Normal file
30
tests/test_config_loader.py
Normal file
@@ -0,0 +1,30 @@
|
||||
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
|
||||
Reference in New Issue
Block a user