@@ -79,19 +79,19 @@ def setup_server(description=None, context=None, cmdline=None):
79
79
# If you initialize a DataBlock to addresses of 0x00 to 0xFF, a request to
80
80
# 0x100 will respond with an invalid address exception.
81
81
# This is because many devices exhibit this kind of behavior (but not all)
82
- if args .store == "sequential" :
82
+ if args .store == "sequential" : # pragma: no cover
83
83
# Continuing, use a sequential block without gaps.
84
84
datablock = lambda : ModbusSequentialDataBlock (0x00 , [17 ] * 100 ) # pylint: disable=unnecessary-lambda-assignment
85
- elif args .store == "sparse" :
85
+ elif args .store == "sparse" : # pragma: no cover
86
86
# Continuing, or use a sparse DataBlock which can have gaps
87
87
datablock = lambda : ModbusSparseDataBlock ({0x00 : 0 , 0x05 : 1 }) # pylint: disable=unnecessary-lambda-assignment
88
- elif args .store == "factory" :
88
+ elif args .store == "factory" : # pragma: no cover
89
89
# Alternately, use the factory methods to initialize the DataBlocks
90
90
# or simply do not pass them to have them initialized to 0x00 on the
91
91
# full address range::
92
92
datablock = lambda : ModbusSequentialDataBlock .create () # pylint: disable=unnecessary-lambda-assignment,unnecessary-lambda
93
93
94
- if args .device_ids > 1 :
94
+ if args .device_ids > 1 : # pragma: no cover
95
95
# The server then makes use of a server context that allows the server
96
96
# to respond with different device contexts for different device ids.
97
97
# By default it will return the same context for every device id supplied
@@ -185,7 +185,7 @@ async def run_async_server(args) -> None:
185
185
# ignore_missing_devices=True, # ignore request to a missing device
186
186
# broadcast_enable=False, # treat device_id 0 as broadcast address,
187
187
)
188
- elif args .comm == "tls" :
188
+ elif args .comm == "tls" : # pragma: no cover
189
189
address = (args .host if args .host else "" , args .port if args .port else None )
190
190
await StartAsyncTlsServer (
191
191
context = args .context , # Data storage
@@ -208,7 +208,7 @@ async def run_async_server(args) -> None:
208
208
)
209
209
210
210
211
- async def async_helper () -> None :
211
+ async def async_helper () -> None : # pragma: no cover
212
212
"""Combine setup and run."""
213
213
_logger .info ("Starting..." )
214
214
run_args = setup_server (description = "Run asynchronous server." )
0 commit comments