@@ -148,15 +148,11 @@ def on_service_state_change(zeroconf, service_type, state_change, name):
148148 zc .send (out )
149149 assert mocked_log_warn .call_count == call_counts [0 ]
150150
151- # force a receive of a packet
152- packet = out .packets ()[0 ]
153- s = zc ._respond_sockets [0 ]
154-
155151 # mock the zeroconf logger and check for the correct logging backoff
156152 call_counts = mocked_log_warn .call_count , mocked_log_debug .call_count
157153 # force receive on oversized packet
158- s . sendto ( packet , 0 , ( const ._MDNS_ADDR , const ._MDNS_PORT ) )
159- s . sendto ( packet , 0 , ( const ._MDNS_ADDR , const ._MDNS_PORT ) )
154+ zc . send ( out , const ._MDNS_ADDR , const ._MDNS_PORT )
155+ zc . send ( out , const ._MDNS_ADDR , const ._MDNS_PORT )
160156 time .sleep (2.0 )
161157 zeroconf .log .debug (
162158 'warn %d debug %d was %s' , mocked_log_warn .call_count , mocked_log_debug .call_count , call_counts
@@ -166,28 +162,6 @@ def on_service_state_change(zeroconf, service_type, state_change, name):
166162 # close our zeroconf which will close the sockets
167163 zc .close ()
168164
169- # pop the big chunk off the end of the data and send on a closed socket
170- out .data .pop ()
171- zc ._GLOBAL_DONE = False
172-
173- # mock the zeroconf logger and check for the correct logging backoff
174- call_counts = mocked_log_warn .call_count , mocked_log_debug .call_count
175- # send on a closed socket (force a socket error)
176- zc .send (out )
177- zeroconf .log .debug (
178- 'warn %d debug %d was %s' , mocked_log_warn .call_count , mocked_log_debug .call_count , call_counts
179- )
180- assert mocked_log_warn .call_count > call_counts [0 ]
181- assert mocked_log_debug .call_count > call_counts [0 ]
182- zc .send (out )
183- zeroconf .log .debug (
184- 'warn %d debug %d was %s' , mocked_log_warn .call_count , mocked_log_debug .call_count , call_counts
185- )
186- assert mocked_log_debug .call_count > call_counts [0 ] + 2
187-
188- mocked_log_warn .stop ()
189- mocked_log_debug .stop ()
190-
191165 def verify_name_change (self , zc , type_ , name , number_hosts ):
192166 desc = {'path' : '/~paulsm/' }
193167 info_service = ServiceInfo (
0 commit comments