mobilityhouse / ocpp

Python implementation of the Open Charge Point Protocol (OCPP).
MIT License
766 stars 298 forks source link

camel_to_snake_case doesn't handle v2x correctly #591

Closed Jared-Newell-Mobility closed 7 months ago

Jared-Newell-Mobility commented 7 months ago
@pytest.mark.parametrize(
    "test_input,expected",
    [
        ({"evMinV2XEnergyRequest": 200}, {"ev_min_v2x_energy_request": 200}),
        ({"v2xChargingCtrlr": 200}, {"v2x_charging_ctrlr": 200}),
    ],
)
def test_camel_to_snake_case(test_input, expected):
    result = camel_to_snake_case(test_input)
    assert result == expected

Expected :{'ev_min_v2x_energy_request': 200}
Actual   :{'ev_min_v2_x_energy_request': 200}
OrangeTux commented 7 months ago

Can you format the text so the code appears as a code block? That makes the code easier to read, imho,

Jared-Newell-Mobility commented 7 months ago

Merged so closing