File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ async def _connect(self):
101101 """Connect."""
102102 _logger .debug ("Connecting." )
103103 try :
104- if self .params .host .startswith ("unit :" ):
104+ if self .params .host .startswith ("unix :" ):
105105 transport , protocol = await asyncio .wait_for (
106106 self .loop .create_unit_connection (
107107 self ._create_protocol , path = self .params .host [5 :]
Original file line number Diff line number Diff line change 55import pytest_asyncio
66
77from pymodbus import pymodbus_apply_logging_config
8- # from pymodbus.client import AsyncModbusTcpClient
8+ from pymodbus .client import AsyncModbusTcpClient
99from pymodbus .datastore import (
1010 ModbusSequentialDataBlock ,
1111 ModbusServerContext ,
@@ -44,9 +44,6 @@ async def _helper_server():
4444# async def run_client(test_comm, test_type, args=Commandline.copy()):
4545# """Help run async client."""
4646#
47- # args.comm = test_comm
48- # if test_comm == "serial":
49- # args.port = f"socket://127.0.0.1:{args.port}"
5047# test_client = setup_async_client(args=args)
5148# if not test_type:
5249# await run_async_client(test_client)
@@ -62,9 +59,10 @@ async def test_unix_server(_mock_run_server):
6259
6360async def test_unix_async_client (_mock_run_server ):
6461 """Run async client with unit domain socket."""
65- # client = AsyncModbusTcpClient(
66- # HOST,
67- # framer=ModbusSocketFramer,
68- # )
69-
7062 await asyncio .sleep (0.1 )
63+ client = AsyncModbusTcpClient (
64+ HOST ,
65+ framer = ModbusSocketFramer ,
66+ )
67+ await client .connect ()
68+ assert client .connected
You can’t perform that action at this time.
0 commit comments