mobilityhouse / ocpp

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

Update tests to use Call and CallResult without the suffix Payload #593

Closed Jared-Newell-Mobility closed 7 months ago

Jared-Newell-Mobility commented 7 months ago
test_charge_point.py::test_remove_nones
v16/test_v16_charge_point.py::test_call_with_unique_id_should_return_same_id
v16/test_v16_charge_point.py::test_call_without_unique_id_should_return_a_random_value
  /home/jared/PycharmProjects/ocpp/ocpp/v16/call.py:653: UserWarning: BootNotificationPayload is deprecated, use instead BootNotification
    warnings.warn(

test_charge_point.py::test_nested_remove_nones
  /home/jared/PycharmProjects/ocpp/ocpp/v201/call.py:1200: UserWarning: SetNetworkProfilePayload is deprecated, use instead SetNetworkProfile
    warnings.warn(

test_charge_point.py::test_nested_list_remove_nones
  /home/jared/PycharmProjects/ocpp/ocpp/v16/call.py:718: UserWarning: MeterValuesPayload is deprecated, use instead MeterValues
    warnings.warn(

test_charge_point.py::test_remove_nones_with_list_of_strings
  /home/jared/PycharmProjects/ocpp/ocpp/v16/call.py:428: UserWarning: GetConfigurationPayload is deprecated, use instead GetConfiguration
    warnings.warn(

test_charge_point.py::test_call_unique_id_added_to_handler_args_correctly
v16/test_v16_charge_point.py::test_route_message_with_existing_route
v16/test_v16_charge_point.py::test_route_message_without_validation
v16/test_v16_charge_point.py::test_call_with_unique_id_should_return_same_id
v16/test_v16_charge_point.py::test_call_without_unique_id_should_return_a_random_value
  /home/jared/PycharmProjects/ocpp/ocpp/v16/call_result.py:279: UserWarning: BootNotificationPayload is deprecated, use instead BootNotification
    warnings.warn(

v16/test_v16_charge_point.py::test_send_call_with_timeout
v16/test_v16_charge_point.py::test_send_invalid_call
  /home/jared/PycharmProjects/ocpp/ocpp/v16/call.py:545: UserWarning: ResetPayload is deprecated, use instead Reset
    warnings.warn(

v16/test_v16_charge_point.py::test_raise_call_error
v16/test_v16_charge_point.py::test_suppress_call_error
  /home/jared/PycharmProjects/ocpp/ocpp/v16/call.py:363: UserWarning: ClearCachePayload is deprecated, use instead ClearCache
    warnings.warn(

v201/test_v201_charge_point.py::test_route_message_with_existing_route
v201/test_v201_charge_point.py::test_call_with_unique_id_should_return_same_id
v201/test_v201_charge_point.py::test_call_without_unique_id_should_return_a_random_value
  /home/jared/PycharmProjects/ocpp/ocpp/v201/call_result.py:443: UserWarning: BootNotificationPayload is deprecated, use instead BootNotification
    warnings.warn(

v201/test_v201_charge_point.py::test_call_with_unique_id_should_return_same_id
v201/test_v201_charge_point.py::test_call_without_unique_id_should_return_a_random_value
  /home/jared/PycharmProjects/ocpp/ocpp/v201/call.py:511: UserWarning: BootNotificationPayload is deprecated, use instead BootNotification
    warnings.warn(
Jared-Newell-Mobility commented 7 months ago

Also a bug found ocpp/charge_point/call

https://github.com/mobilityhouse/ocpp/blob/ae02ede445ea56375505d21bd498a88fce937862/ocpp/charge_point.py#L314-L318

action_name = payload.__class__.__name__
# Due to deprecated call and callresults, remove in the future.
if "Payload" in payload.__class__.__name__:
    action_name = payload.__class__.__name__[:-7]
Jared-Newell-Mobility commented 7 months ago

Merged so closing