@@ -78,7 +78,6 @@ def run_sync_client():
7878 # which defaults to `0x00`
7979 # ----------------------------------------------------------------------- #
8080 log .debug ("Reading Coils" )
81-
8281 rr = client .read_coils (1 , 1 , unit = UNIT )
8382 log .debug (rr )
8483
@@ -98,14 +97,14 @@ def run_sync_client():
9897 log .debug ("Write to a Coil and read back" )
9998 rq = client .write_coil (0 , True , unit = UNIT )
10099 rr = client .read_coils (0 , 1 , unit = UNIT )
101- assert (rq .isError () is False ) # test that we are not an error
100+ assert (not rq .isError ()) # test that we are not an error
102101 assert (rr .bits [0 ] == True ) # test the expected value
103102
104103 log .debug ("Write to multiple coils and read back- test 1" )
105104 rq = client .write_coils (1 , [True ]* 8 , unit = UNIT )
106- assert (rq .isError () is False ) # test that we are not an error
105+ assert (not rq .isError ()) # test that we are not an error
107106 rr = client .read_coils (1 , 21 , unit = UNIT )
108- assert (rr .isError () is False ) # test that we are not an error
107+ assert (not rr .isError ()) # test that we are not an error
109108 resp = [True ]* 21
110109
111110 # If the returned output quantity is not a multiple of eight,
@@ -118,28 +117,28 @@ def run_sync_client():
118117 log .debug ("Write to multiple coils and read back - test 2" )
119118 rq = client .write_coils (1 , [False ]* 8 , unit = UNIT )
120119 rr = client .read_coils (1 , 8 , unit = UNIT )
121- assert (rq .isError () is False ) # test that we are not an error
120+ assert (not rq .isError ()) # test that we are not an error
122121 assert (rr .bits == [False ]* 8 ) # test the expected value
123122
124123 log .debug ("Read discrete inputs" )
125124 rr = client .read_discrete_inputs (0 , 8 , unit = UNIT )
126- assert (rq .isError () is False ) # test that we are not an error
125+ assert (not rq .isError ()) # test that we are not an error
127126
128127 log .debug ("Write to a holding register and read back" )
129128 rq = client .write_register (1 , 10 , unit = UNIT )
130129 rr = client .read_holding_registers (1 , 1 , unit = UNIT )
131- assert (rq .isError () is False ) # test that we are not an error
130+ assert (not rq .isError ()) # test that we are not an error
132131 assert (rr .registers [0 ] == 10 ) # test the expected value
133132
134133 log .debug ("Write to multiple holding registers and read back" )
135134 rq = client .write_registers (1 , [10 ]* 8 , unit = UNIT )
136135 rr = client .read_holding_registers (1 , 8 , unit = UNIT )
137- assert (rq .isError () is False ) # test that we are not an error
136+ assert (not rq .isError ()) # test that we are not an error
138137 assert (rr .registers == [10 ]* 8 ) # test the expected value
139138
140139 log .debug ("Read input registers" )
141140 rr = client .read_input_registers (1 , 8 , unit = UNIT )
142- assert (rq .isError () is False ) # test that we are not an error
141+ assert (not rq .isError ()) # test that we are not an error
143142
144143 arguments = {
145144 'read_address' : 1 ,
@@ -150,7 +149,7 @@ def run_sync_client():
150149 log .debug ("Read write registeres simulataneously" )
151150 rq = client .readwrite_registers (unit = UNIT , ** arguments )
152151 rr = client .read_holding_registers (1 , 8 , unit = UNIT )
153- assert (rq .isError () is False ) # test that we are not an error
152+ assert (not rq .isError ()) # test that we are not an error
154153 assert (rq .registers == [20 ]* 8 ) # test the expected value
155154 assert (rr .registers == [20 ]* 8 ) # test the expected value
156155
0 commit comments