Skip to content

Commit f9d477a

Browse files
committed
Part 2 of updates
1 parent d02d5ee commit f9d477a

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

canopen/node/local.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def associate_network(self, network: canopen.network.Network):
5151
network.subscribe(0, self.nmt.on_command)
5252

5353
def remove_network(self) -> None:
54-
# Make it safe to call this method multiple times
5554
if not self.has_network():
5655
return
5756
self.network.unsubscribe(self.sdo.rx_cobid, self.sdo.on_request)

canopen/node/remote.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def associate_network(self, network: canopen.network.Network):
6666
network.subscribe(0, self.nmt.on_command)
6767

6868
def remove_network(self) -> None:
69-
# Make it safe to call this method multiple times
7069
if not self.has_network():
7170
return
7271
for sdo in self.sdo_channels:

test/test_node.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
import canopen
55
import canopen.network
6-
7-
from .util import SAMPLE_EDS
6+
import canopen.objectdictionary
87

98

109
def count_subscribers(network: canopen.Network) -> int:
@@ -23,17 +22,16 @@ def setUpClass(cls):
2322
cls.network.NOTIFIER_SHUTDOWN_TIMEOUT = 0.0
2423
cls.network.connect(interface="virtual")
2524

26-
cls.node = canopen.LocalNode(2, SAMPLE_EDS)
25+
cls.node = canopen.LocalNode(2, canopen.objectdictionary.ObjectDictionary())
2726

2827
@classmethod
2928
def tearDownClass(cls):
3029
cls.network.disconnect()
3130

3231
def test_associate_network(self):
3332

34-
# Need to store the number of subscribers before associating because
35-
# the current network implementation automatically adds subscribers
36-
# to the list
33+
# Need to store the number of subscribers before associating because the
34+
# network implementation automatically adds subscribers to the list
3735
n_subscribers = count_subscribers(self.network)
3836

3937
# Associating the network with the local node
@@ -75,17 +73,16 @@ def setUpClass(cls):
7573
cls.network.NOTIFIER_SHUTDOWN_TIMEOUT = 0.0
7674
cls.network.connect(interface="virtual")
7775

78-
cls.node = canopen.RemoteNode(2, SAMPLE_EDS)
76+
cls.node = canopen.RemoteNode(2, canopen.objectdictionary.ObjectDictionary())
7977

8078
@classmethod
8179
def tearDownClass(cls):
8280
cls.network.disconnect()
8381

8482
def test_associate_network(self):
8583

86-
# Need to store the number of subscribers before associating because
87-
# the current network implementation automatically adds subscribers
88-
# to the list
84+
# Need to store the number of subscribers before associating because the
85+
# network implementation automatically adds subscribers to the list
8986
n_subscribers = count_subscribers(self.network)
9087

9188
# Associating the network with the local node

0 commit comments

Comments
 (0)