refactor(opc): Rename async close method to aclose
Renamed the OPC.close asynchronous method to OPC.aclose to align with common Python conventions for asynchronous context managers and methods, improving clarity. All call sites and tests have been updated accordingly.
This commit is contained in:
@@ -164,6 +164,6 @@ class Activities(Storage, MLFlow, Gates, OPC, ModelMetrics, API):
|
|||||||
Storage.close(self)
|
Storage.close(self)
|
||||||
MLFlow.close(self)
|
MLFlow.close(self)
|
||||||
Gates.close(self)
|
Gates.close(self)
|
||||||
await OPC.close(self)
|
await OPC.aclose(self)
|
||||||
ModelMetrics.close(self)
|
ModelMetrics.close(self)
|
||||||
API.close(self)
|
API.close(self)
|
||||||
|
|||||||
@@ -491,7 +491,7 @@ class OPC(SientiaMonitoring):
|
|||||||
|
|
||||||
return data.to_dict()
|
return data.to_dict()
|
||||||
|
|
||||||
async def close(self):
|
async def aclose(self):
|
||||||
"""
|
"""
|
||||||
Gracefully shutdown all OPC server connections and cleanup resources.
|
Gracefully shutdown all OPC server connections and cleanup resources.
|
||||||
|
|
||||||
|
|||||||
@@ -734,5 +734,5 @@ async def test_validate_server(opc):
|
|||||||
@mark.asyncio
|
@mark.asyncio
|
||||||
async def test_close(opc):
|
async def test_close(opc):
|
||||||
opc.opc_repository['server1'].disconnect = AsyncMock(return_value=True)
|
opc.opc_repository['server1'].disconnect = AsyncMock(return_value=True)
|
||||||
await opc.close()
|
await opc.aclose()
|
||||||
opc.opc_repository['server1'].disconnect.assert_called_once()
|
opc.opc_repository['server1'].disconnect.assert_called_once()
|
||||||
|
|||||||
Reference in New Issue
Block a user