Skip to content

Commit

Permalink
keep routemap
Browse files Browse the repository at this point in the history
  • Loading branch information
drc38 authored Oct 20, 2023
1 parent 7269fa8 commit 67eaa1e
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions tests/v16/test_v16_charge_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,49 +109,47 @@ def on_boot_notification(**kwargs): # noqa


@pytest.mark.asyncio
async def test_route_message_with_no_route(base_central_system, heartbeat_call):
async def test_route_message_not_supported(base_central_system, notsupported_call):
"""
Test that a CALLERROR is sent back, reporting that no handler is
registred for it.
Test that a CALLERROR is sent back, reporting that it is
not supported by OCPP version.
"""
# Empty the route map
base_central_system.route_map = {}

await base_central_system.route_message(heartbeat_call)
await base_central_system.route_message(notsupported_call)
base_central_system._connection.send.assert_called_once_with(
json.dumps(
[
4,
1,
"NotImplemented",
"Request Action is recognized but not supported by the receiver",
{"cause": "No handler for Heartbeat registered."},
"NotSupported",
"Requested Action is not known by receiver",
{"cause": "InvalidAction not supported by OCPP1.6."},
],
separators=(",", ":"),
)
)


@pytest.mark.asyncio
async def test_route_message_not_supported(base_central_system, notsupported_call):
async def test_route_message_with_no_route(base_central_system, heartbeat_call):
"""
Test that a CALLERROR is sent back, reporting that it is
not supported by OCPP version.
Test that a CALLERROR is sent back, reporting that no handler is
registred for it.
"""
# Empty the route map
base_central_system.route_map = {}

await base_central_system.route_message(notsupported_call)
await base_central_system.route_message(heartbeat_call)
base_central_system._connection.send.assert_called_once_with(
json.dumps(
[
4,
1,
"NotSupported",
"Requested Action is not known by receiver",
{"cause": "InvalidAction not supported by OCPP1.6."},
"NotImplemented",
"Request Action is recognized but not supported by the receiver",
{"cause": "No handler for Heartbeat registered."},
],
separators=(",", ":"),
)
Expand Down

0 comments on commit 67eaa1e

Please sign in to comment.