6060from pymodbus .transport import NULLMODEM_HOST , CommParams , CommType , ModbusProtocol
6161
6262
63- port = 5004
64-
6563class TransportStub (ModbusProtocol ):
6664 """Protocol layer including transport."""
6765
@@ -101,14 +99,14 @@ def callback_new_connection(self) -> ModbusProtocol:
10199 return new_stub
102100
103101
104- test_port = 5004
102+ test_port = 5004 # pylint: disable=invalid-name
105103
106104class ClientTester : # pylint: disable=too-few-public-methods
107105 """Main program."""
108106
109107 def __init__ (self , comm : CommType ):
110108 """Initialize runtime tester."""
111- global test_port
109+ global test_port # pylint: disable=global-statement
112110 self .comm = comm
113111 host = NULLMODEM_HOST
114112
@@ -147,7 +145,7 @@ class ServerTester: # pylint: disable=too-few-public-methods
147145
148146 def __init__ (self , comm : CommType ):
149147 """Initialize runtime tester."""
150- global test_port
148+ global test_port # pylint: disable=global-statement
151149 self .comm = comm
152150 self .store = ModbusSlaveContext (
153151 di = ModbusSequentialDataBlock (0 , [17 ] * 100 ),
@@ -240,7 +238,7 @@ async def server_calls(transport: ModbusProtocol, is_tcp: bool):
240238
241239def simulate_server (transport : ModbusProtocol , is_tcp : bool , request : bytes ):
242240 """Respond to request at transport level."""
243- Log .debug ("--> Server simulater called with request {}." , request , ":hex" )
241+ Log .debug ("--> Server simulator called with request {}." , request , ":hex" )
244242 if is_tcp :
245243 response = b'\x00 \x01 \x00 \x00 \x00 \x06 \x00 \x03 \x00 \x7c \x00 \x04 '
246244 else :
@@ -253,7 +251,7 @@ def simulate_server(transport: ModbusProtocol, is_tcp: bool, request: bytes):
253251 transport .send (response )
254252
255253
256- def simulate_client (_transport : ModbusProtocol , is_tcp : bool , response : bytes ):
254+ def simulate_client (_transport : ModbusProtocol , _is_tcp : bool , response : bytes ):
257255 """Respond to request at transport level."""
258256 Log .debug ("--> Client simulator called with response {}." , response , ":hex" )
259257
0 commit comments