From 22fc091dc0d11263a55f214e3a9ee51d061814d7 Mon Sep 17 00:00:00 2001 From: AssemblyJohn Date: Fri, 15 Nov 2024 16:36:30 +0200 Subject: [PATCH] Updated for external central system Signed-off-by: AssemblyJohn --- .../src/everest/testing/ocpp_utils/central_system.py | 12 +++++------- .../src/everest/testing/ocpp_utils/fixtures.py | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/everest-testing/src/everest/testing/ocpp_utils/central_system.py b/everest-testing/src/everest/testing/ocpp_utils/central_system.py index cc2ac45..d7cfb84 100644 --- a/everest-testing/src/everest/testing/ocpp_utils/central_system.py +++ b/everest-testing/src/everest/testing/ocpp_utils/central_system.py @@ -6,7 +6,7 @@ import ssl import time import logging -from abc import ABC, abstractmethod +from abc import abstractmethod from contextlib import asynccontextmanager from functools import wraps from typing import Union, Optional @@ -41,8 +41,7 @@ def __init__(self, chargepoint_id, ocpp_version, port: Optional[int] = None): @abstractmethod async def on_connect(self, websocket, path): - logging.error("'CentralSystem' did not implement 'on_connect'!") - pass + logging.error("'CentralSystem' did not implement 'on_connect'!") @abstractmethod async def wait_for_chargepoint(self, timeout=30, wait_for_bootnotification=True): @@ -51,18 +50,17 @@ async def wait_for_chargepoint(self, timeout=30, wait_for_bootnotification=True) @abstractmethod async def start(self, ssl_context=None): - logging.error("'CentralSystem' did not implement 'start'!") - pass + logging.error("'CentralSystem' did not implement 'start'!") pass # End CentralSystem -class LocalCentralSystem(CentralSystem): +class LocalCentralSystem(CentralSystem): """Wrapper for CSMS websocket server. Holds a reference to a single connected chargepoint """ def __init__(self, chargepoint_id, ocpp_version, port: Optional[int] = None): super().__init__(chargepoint_id, ocpp_version, port) - self.name = "LocalCentralSystem" + self.name = "LocalCentralSystem" async def on_connect(self, websocket, path): """ For every new charge point that connects, create a ChargePoint diff --git a/everest-testing/src/everest/testing/ocpp_utils/fixtures.py b/everest-testing/src/everest/testing/ocpp_utils/fixtures.py index 60d541a..e5874bd 100644 --- a/everest-testing/src/everest/testing/ocpp_utils/fixtures.py +++ b/everest-testing/src/everest/testing/ocpp_utils/fixtures.py @@ -69,7 +69,7 @@ async def central_system(request, ocpp_version: OCPPVersion, test_config): central_system_marker = request.node.get_closest_marker('custom_central_system') if central_system_marker: - assert isinstance(central_system_marker.args[0], CentralSystem) + assert isinstance(central_system_marker.args[0], CentralSystem) cs = central_system_marker.args[0] else: cs = LocalCentralSystem(test_config.charge_point_info.charge_point_id,