Skip to content

Commit 5ef4771

Browse files
committed
Requests by reviewer: bugfixes
1 parent 1131c8d commit 5ef4771

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

canopen/sdo/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __init__(self, code: Union[int, str]):
5252
except ValueError as e:
5353
raise ValueError(f"Unknown SDO abort description: {code}") from e
5454
else:
55-
self.code = code
55+
self.code = code
5656

5757
def __str__(self):
5858
text = f"Code 0x{self.code:08X}"

test/test_local.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ def test_expedited_upload(self):
3737
vendor_id = self.remote_node.sdo[0x1400][1].raw
3838
self.assertEqual(vendor_id, 0x99)
3939

40-
def test_block_upload_switch_to_expedite_upload(self):
41-
with self.assertRaises(canopen.SdoCommunicationError) as context:
42-
with self.remote_node.sdo[0x1008].open('r', block_transfer=True) as fp:
43-
pass
44-
# We get this since the sdo client don't support the switch
45-
# from block upload to expedite upload
46-
self.assertEqual("Unexpected response 0x41", str(context.exception))
40+
# Remove this test, as Block upload is now supported:
41+
# def test_block_upload_switch_to_expedite_upload(self):
42+
# with self.assertRaises(canopen.SdoCommunicationError) as context:
43+
# with self.remote_node.sdo[0x1008].open('r', block_transfer=True) as fp:
44+
# pass
45+
# # We get this since the sdo client don't support the switch
46+
# # from block upload to expedite upload
47+
# self.assertEqual("Unexpected response 0x41", str(context.exception))
4748

4849
def test_block_download_not_supported(self):
4950
data = b"TEST DEVICE"

test/test_sdo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import canopen.objectdictionary.datatypes as dt
55
from canopen.objectdictionary import ODVariable
66

7-
from util import DATATYPES_EDS, SAMPLE_EDS
7+
from .util import DATATYPES_EDS, SAMPLE_EDS
88

99

1010
TX = 1

0 commit comments

Comments
 (0)