refactor(websocket): use robot_name alias instead of duplicate wrapper method
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,8 @@ from robot.api import logger
|
||||
class WebSocketKeywords:
|
||||
"""Keywords for WebSocket testing."""
|
||||
|
||||
ROBOT_AUTO_KEYWORDS = True
|
||||
|
||||
def __init__(self):
|
||||
self._connection: Optional[websockets.WebSocketClientProtocol] = None
|
||||
|
||||
@@ -25,9 +27,7 @@ class WebSocketKeywords:
|
||||
asyncio.run(self._async_connect(ws_url))
|
||||
return f"Connected to {ws_url}"
|
||||
|
||||
def Connect_To_WebSocket(self, ws_url: str) -> str:
|
||||
"""Robot Framework alias for connect_to_websocket."""
|
||||
return self.connect_to_websocket(ws_url)
|
||||
connect_to_websocket.robot_name = "Connect To WebSocket"
|
||||
|
||||
async def _async_connect(self, ws_url: str) -> None:
|
||||
self._connection = await websockets.connect(ws_url)
|
||||
|
||||
Reference in New Issue
Block a user