Skip to content

Commit

Permalink
Updated for external central system
Browse files Browse the repository at this point in the history
Signed-off-by: AssemblyJohn <ioan.bogdann@gmail.com>
  • Loading branch information
AssemblyJohn committed Nov 19, 2024
1 parent afa8463 commit 22fc091
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions everest-testing/src/everest/testing/ocpp_utils/central_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -41,8 +41,7 @@ def __init__(self, chargepoint_id, ocpp_version, port: Optional[int] = None):

Check notice on line 41 in everest-testing/src/everest/testing/ocpp_utils/central_system.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

everest-testing/src/everest/testing/ocpp_utils/central_system.py#L41

Trailing whitespace
@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'!")

Check notice on line 44 in everest-testing/src/everest/testing/ocpp_utils/central_system.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

everest-testing/src/everest/testing/ocpp_utils/central_system.py#L44

Trailing whitespace

@abstractmethod
async def wait_for_chargepoint(self, timeout=30, wait_for_bootnotification=True):
Expand All @@ -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'!")

Check notice on line 53 in everest-testing/src/everest/testing/ocpp_utils/central_system.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

everest-testing/src/everest/testing/ocpp_utils/central_system.py#L53

Trailing whitespace

pass # End CentralSystem

Check warning on line 55 in everest-testing/src/everest/testing/ocpp_utils/central_system.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

everest-testing/src/everest/testing/ocpp_utils/central_system.py#L55

Unnecessary pass statement

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):

Check notice on line 61 in everest-testing/src/everest/testing/ocpp_utils/central_system.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

everest-testing/src/everest/testing/ocpp_utils/central_system.py#L61

Trailing whitespace
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
Expand Down
2 changes: 1 addition & 1 deletion everest-testing/src/everest/testing/ocpp_utils/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 22fc091

Please sign in to comment.