@@ -321,23 +321,28 @@ def test_scanner_search_no_network(self):
321
321
self .scanner .search ()
322
322
323
323
def test_scanner_search (self ):
324
- bus = can .Bus (interface = "virtual" , receive_own_messages = True )
325
- net = canopen .Network (bus )
324
+ rxbus = can .Bus (interface = "virtual" )
325
+ self .addCleanup (rxbus .shutdown )
326
+
327
+ txbus = can .Bus (interface = "virtual" )
328
+ self .addCleanup (txbus .shutdown )
329
+
330
+ net = canopen .Network (txbus )
326
331
net .connect ()
327
332
self .addCleanup (net .disconnect )
328
333
329
334
self .scanner .network = net
330
335
self .scanner .search ()
331
336
332
337
payload = bytes ([64 , 0 , 16 , 0 , 0 , 0 , 0 , 0 ])
333
- acc = [bus .recv (self .TIMEOUT ) for _ in range (127 )]
338
+ acc = [rxbus .recv (self .TIMEOUT ) for _ in range (127 )]
334
339
for node_id , msg in enumerate (acc , start = 1 ):
335
340
with self .subTest (node_id = node_id ):
336
341
self .assertIsNotNone (msg )
337
342
self .assertEqual (msg .arbitration_id , 0x600 + node_id )
338
343
self .assertEqual (msg .data , payload )
339
344
# Check that no spurious packets were sent.
340
- self .assertIsNone (bus .recv (self .TIMEOUT ))
345
+ self .assertIsNone (rxbus .recv (self .TIMEOUT ))
341
346
342
347
def test_scanner_search_limit (self ):
343
348
bus = can .Bus (interface = "virtual" , receive_own_messages = True )
0 commit comments