Skip to content

Commit e53395f

Browse files
committed
black2.
1 parent b13507e commit e53395f

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

pymodbus/client/tcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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:]

test/test_unix_socket.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pytest_asyncio
66

77
from pymodbus import pymodbus_apply_logging_config
8-
# from pymodbus.client import AsyncModbusTcpClient
8+
from pymodbus.client import AsyncModbusTcpClient
99
from 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

6360
async 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

0 commit comments

Comments
 (0)