diff --git a/tests/sentier.dev/test_simapro_units.py b/tests/sentier.dev/test_simapro_units.py index 9a8c793..db33136 100644 --- a/tests/sentier.dev/test_simapro_units.py +++ b/tests/sentier.dev/test_simapro_units.py @@ -49,3 +49,38 @@ def test_integration_SPUC(): ] for obj in expected: assert obj in result + + +def test_match_internal_simapro_simapro_with_unit_conversion(): + given = [ + { + "name": "foo", + "location": "bar", + "database": "a", + "code": "b", + "unit": "km", + "exchanges": [ + {"name": "foo", "location": "bar", "unit": "m", "amount": 1000.0} + ], + } + ] + expected = [ + { + "name": "foo", + "location": "bar", + "database": "a", + "code": "b", + "unit": "km", + "exchanges": [ + { + "input": ("a", "b"), + "name": "foo", + "location": "bar", + "unit": "km", + "loc": 1.0, + "amount": 1.0, + } + ], + } + ] + assert match_internal_simapro_simapro_with_unit_conversion(given) == expected