From: Jérôme Benoit Date: Tue, 2 Jul 2024 20:10:29 +0000 (+0200) Subject: fix(ocpp-server): randomize GetBaseReport request id X-Git-Tag: ocpp-server@v1.4.0~31 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8fe113d7ae764df93daaa7a69c6fe810b6703587;p=e-mobility-charging-stations-simulator.git fix(ocpp-server): randomize GetBaseReport request id Signed-off-by: Jérôme Benoit --- diff --git a/tests/ocpp-server/server.py b/tests/ocpp-server/server.py index 483c750f..17e328a6 100644 --- a/tests/ocpp-server/server.py +++ b/tests/ocpp-server/server.py @@ -3,6 +3,7 @@ import asyncio import logging from datetime import datetime, timezone from functools import partial +from random import randint from typing import Optional import ocpp.v201 @@ -108,7 +109,8 @@ class ChargePoint(ocpp.v201.ChargePoint): async def _send_get_base_report(self): request = ocpp.v201.call.GetBaseReport( - request_id=1, report_base=ReportBaseType.full_inventory + request_id=randint(1, 100), # noqa: S311 + report_base=ReportBaseType.full_inventory, ) response = await self.call(request)