-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/cost and price display message tests #975
Conversation
dependencies.yaml
Outdated
@@ -67,7 +67,7 @@ libevse-security: | |||
# OCPP | |||
libocpp: | |||
git: https://github.com/EVerest/libocpp.git | |||
git_tag: 9836ac4766e99a79555adb15c3001c8704f8b7a7 | |||
git_tag: bugfix/meter-value-pricing-trigger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be set back to the correct version as soon as it the bugfix (EVerest/libocpp#899) is merged.
cc61cbf
to
2b40e7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm except a few inline comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests should go into a seperate file like california_pricing.py like for ocpp201
@pytest_asyncio.fixture | ||
async def chargepoint_with_pm(central_system: CentralSystem, probe_module: ProbeModule): | ||
"""Fixture for ChargePoint16. Requires central_system_v201 and test_controller. Starts test_controller immediately | ||
""" | ||
# wait for libocpp to go online | ||
cp = await central_system.wait_for_chargepoint() | ||
yield cp | ||
await cp.stop() | ||
|
||
|
||
class ProbeModuleCostAndPriceMetervaluesConfigurationAdjustment(EverestConfigAdjustmentStrategy): | ||
""" | ||
Probe module to be able to 'inject' metervalues | ||
""" | ||
def adjust_everest_configuration(self, everest_config: Dict): | ||
adjusted_config = deepcopy(everest_config) | ||
|
||
adjusted_config["active_modules"]["grid_connection_point"]["connections"]["powermeter"] = [ | ||
{"module_id": "probe", "implementation_id": "ProbeModulePowerMeter"}] | ||
adjusted_config["active_modules"]["evse_manager"]["connections"]["powermeter_grid_side"] = [ | ||
{"module_id": "probe", "implementation_id": "ProbeModulePowerMeter"}] | ||
|
||
return adjusted_config | ||
|
||
|
||
class ProbeModuleCostAndPriceDisplayMessageConfigurationAdjustment(EverestConfigAdjustmentStrategy): | ||
""" | ||
Probe module to be able to mock display messages | ||
""" | ||
def adjust_everest_configuration(self, everest_config: Dict): | ||
adjusted_config = deepcopy(everest_config) | ||
|
||
adjusted_config["active_modules"]["ocpp"]["connections"]["display_message"] = [ | ||
{"module_id": "probe", "implementation_id": "ProbeModuleDisplayMessage"}] | ||
|
||
return adjusted_config | ||
|
||
|
||
class ProbeModuleCostAndPriceSessionCostConfigurationAdjustment(EverestConfigAdjustmentStrategy): | ||
""" | ||
Probe module to be able to mock the session cost interface calls | ||
""" | ||
def adjust_everest_configuration(self, everest_config: Dict): | ||
adjusted_config = deepcopy(everest_config) | ||
|
||
adjusted_config["active_modules"]["probe"]["connections"]["session_cost"] = [ | ||
{"module_id": "ocpp", "implementation_id": "session_cost"}] | ||
|
||
return adjusted_config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem to be defined similar for ocpp16 and ocpp201 so I think they can be moved to some common file and the be imported
# probe_module.implement_command("ProbeModuleDisplayMessage", "set_display_message", | ||
# probe_module_mock_fn) | ||
# probe_module.implement_command("ProbeModuleDisplayMessage", "get_display_messages", | ||
# probe_module_mock_fn) | ||
# probe_module.implement_command("ProbeModuleDisplayMessage", "clear_display_message", | ||
# probe_module_mock_fn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be removed?
5783a7e
to
37f21a6
Compare
37f21a6
to
2db9d09
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just use the name california_pricing.py
for this file since its inside the ocpp16
directory
37f21a6
to
427dd02
Compare
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…icing tests for 1.6 to a new file. Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…licting test file names) Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…st file names. Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
d9b8c7e
to
7508df8
Compare
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Describe your changes
Add python integration tests for california pricing and display message.
Bugfix found by adding the tests: EVerest/libocpp#899
Issue ticket number and link
Checklist before requesting a review