feat(workflows): Update CI configuration and enhance testing conditions
- Added workflow_run triggers for "Deploy Development" and "Deploy Production" to ensure tests run only after successful deployments. - Updated Python version in CI from 3.12 to 3.11 for better compatibility with the Debian 12 ARM64 runner. - Enhanced job conditions to skip tests on failed workflow runs. - Improved frontend build process by updating Node.js setup and ensuring correct directory navigation. - Refined CSV parsing logic to handle custom and unknown source units, enhancing conversion flexibility. - Added new tests for custom source unit handling in CSV conversions, ensuring accurate processing.
This commit is contained in:
1 parent
d6d7e738a5
commit
0d0ab62674
5 files changed
+53
-9
No files matched your search
@@ -86,6 +86,19 @@ def test_convert_protein_kg_to_g():
|
||||
assert abs(g - 100.0) < 0.001
|
||||
|
||||
|
||||
def test_convert_custom_source_unit_only_conversion_factor():
|
||||
"""Nicht vordefinierte Umrechnung: conversion_factor (optional mit source_unit: custom)."""
|
||||
spec = {"type": "float", "source_unit": "custom", "conversion_factor": 2.5, "decimal_separator": "."}
|
||||
k = convert_value("100", "kcal", spec, module="nutrition")
|
||||
assert abs(k - 250.0) < 0.001
|
||||
|
||||
|
||||
def test_convert_unknown_source_unit_uses_conversion_factor_only():
|
||||
spec = {"type": "float", "source_unit": "exotic_unit", "conversion_factor": 0.5, "decimal_separator": "."}
|
||||
k = convert_value("200", "kcal", spec, module="nutrition")
|
||||
assert abs(k - 100.0) < 0.001
|
||||
|
||||
|
||||
def test_build_row_source_unit_without_module_no_factor():
|
||||
"""Ohne module bleibt source_unit wirkungslos (Abwärtskompatibilität)."""
|
||||
spec = {"type": "float", "source_unit": "kj", "decimal_separator": "."}
|
||||
|
||||
Reference in new issue
Block a user